Round numbers with arbitrary precision.
round('149', 3)
// => 149
round('149', 2)
// => 15
round('149', 1)
// => 1
round('99', 1)
// => throws
$ npm install round-string
This module operates on strings instead of numbers, because JavaScript numbers don't support arbitrary precision. Strings however can be as long as you want.
MIT