0.0.4 • Published 5 years ago

expected-round v0.0.4

Weekly downloads
167
License
ISC
Repository
-
Last release
5 years ago

A simple rounder to expected values for JavaScript.

This has not been performance tested.

Install

npm i --save expected-round

Usage
const expectedRound = require('expected-round')
expectedRound.round10(1.005, -2) // Rounds 1.005 to 2 decimal places

Plain JS vs Expected-Round comparison.

Plain JS
Math.round(1.005 * 100) / 100 // outputs 1
Expected-Round
round10(1.005, -2) // outputs 1.01
0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago