Closed ntwilson closed 4 years ago
Hm -- that's not good. Seems that there's something wrong in the Numbers formatter: https://github.com/purescript-contrib/purescript-formatters/blob/master/src/Data/Formatter/Number.purs
and there's no test for various rounding lengths in the Numbers tests: https://github.com/purescript-contrib/purescript-formatters/blob/master/test/src/Number.purs
I agree that the most sensible thing to do is to round the number, not floor it, and that this behavior is unexpected. I don't have time at the moment to fix this but I've added the 'help wanted' label for anyone who is able to take a quick stab at it.
I took a stab at it, but as I mentioned in my PR, this is my first PR to any of the PureScript core libs, so a solid review would really help!
from the REPL:
However, if there are no trailing digits, it seems to work
though it's an interesting behavior in that it floors instead of rounds, when other digits do round: