swarm-numberformat
swarm-numberformat copied to clipboard
Rounds small values to 0
Sometimes I want to introduce something that gets produced at a low rate like .1/s. If I use this to format 0.1, it just rounds it to 0, ignoring sigfigs.
This may be relevant
https://en.wikipedia.org/wiki/Names_of_small_numbers
Essentially they are the same names but with the -th suffix e.g. 1e−6 -> Millionth.
Overlooked this, sorry for the delay.
Use maxSmall
when you might have small numbers to avoid rounding. Here's a unit test to demonstrate: https://github.com/erosson/swarm-numberformat/commit/dd3d32ab155f79c5055138a1ab73a7c9ea9f6d04
Thousandth, millionth, etc: No need for this in my projects, so I'm not planning to add it anytime soon. Happy to take pull requests, though!