-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Fix determineUnitForFormatting floating point error #6259
Fix determineUnitForFormatting floating point error #6259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also looking into this problem today.
@benmccann can you please detail the issue (why we need +1 and the 0.1 epsilon) and ideally a codepen that reproduces it? |
The reason of |
The floating point error occurs when the time difference in milliseconds is converted to months or years because the length of a month or year varies. |
ad8609f
to
b41969b
Compare
@simonbrunel I'm assuming you don't need me to create a codepen since you removed the "needs test case" label. The test I wrote reproduces it though and fails without this change |
Correct, I was a bit confused about the |
No description provided.