Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duration.toISOString() fractional seconds still have precision issues with certain values #2376

Closed
creedasaurus opened this issue Jul 14, 2023 · 2 comments · Fixed by #2377
Closed
Labels

Comments

@creedasaurus
Copy link
Contributor

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

@creedasaurus
Copy link
Contributor Author

Sorry, I don't know if there are any conditions for cutting a new release, but any idea when an 1.11.10 might be released? 😅

@github-actions
Copy link

🎉 This issue has been resolved in version 1.11.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant