Duration.toISOString()
fractional seconds still have precision issues with certain values
#2376
Labels
Duration.toISOString()
fractional seconds still have precision issues with certain values
#2376
Problem: originally submitted in #2366 - I didn't completely fix this apparently. I mistakenly assumed I could round the milliseconds value alone, and then add it to the integer of seconds. However Javascript will encounter floating-point rounding errors occasionally and the same precision issues are seen.
Expected behavior
Example:
Input: duration(2812)
Expected: PT2.812S
Actual: PT2.8120000000000003S
Information
Day.js Version [e.g. dev]
OS: All
Browser All
Time zone: N/A
The text was updated successfully, but these errors were encountered: