Neovictorian Paisley Menswear
Learn how companies like Phone2Action are using npm in their front-end developmentJoin the conversation »

expected-round

0.0.4 • Public • Published

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

Install

npm i expected-round

DownloadsWeekly Downloads

25

Version

0.0.4

License

ISC

Unpacked Size

2.45 kB

Total Files

3

Last publish

Collaborators

  • avatar