borgar / numfmt

Full ECMA-376 number and date formatting in JavaScript
40 stars 9 forks source link

dateToSerial should round output #49

Open borgar opened 4 months ago

borgar commented 4 months ago

Something like 18:22:35 will yield 0.7656828703693463 which has "useless" decimals beyond the ninth:

0.765682864 => "18:22:34.999" 0.765682865 => "18:22:35.000" 0.765682876 => "18:22:35.000" 0.765682877 => "18:22:35.001"

It may be misleading to emit this amount of precision when the library does not really support it in any other date handling.