Fix determineUnitForFormatting floating point error#6259
Fix determineUnitForFormatting floating point error#6259simonbrunel merged 2 commits intochartjs:masterfrom
Conversation
nagix
left a comment
There was a problem hiding this comment.
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.