1.0.1 • Published 8 years ago

round-string v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

round-string

Round numbers with arbitrary precision.

Usage

round('149', 3)
// => 149

round('149', 2)
// => 15

round('149', 1)
// => 1

round('99', 1)
// => throws

Installation

$ npm install round-string

API

round(num, len)

Reasoning

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.

License

MIT