Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

jhohlfeld/round10

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inspired by Decimal rounding polyfill by MDN.

Installation

Install using npm:

$ npm install round10

Usage

Use in your project:

$ npm install --save round10

and in your code:

var round10 = require('round10').round10;
round10(55.55, -1); // 55.6

Optionally, you may use the polyfill which extends the global Math object:

require('round10').polyfill();
Math.round10(55.55, -1); // 55.6

Check out the code

$ git clone [email protected]:jhohlfeld/round10.git
$ cd round10
$ npm install

Test using mocha:

$ npm install -g mocha
$ mocha test/test.js

About

Brings decimal adjustment to the Math object.

Resources

Stars

Watchers

Forks

Packages

No packages published