This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/dxfdwgimporter/node_modules/dxf/node_modules/round10
2020-08-31 21:25:41 +02:00
..
test different large refactorings (subdirectores, removed obsolete stuff) and 2020-08-31 21:25:41 +02:00
.npmignore different large refactorings (subdirectores, removed obsolete stuff) and 2020-08-31 21:25:41 +02:00
package.json different large refactorings (subdirectores, removed obsolete stuff) and 2020-08-31 21:25:41 +02:00
README.md different large refactorings (subdirectores, removed obsolete stuff) and 2020-08-31 21:25:41 +02:00
round10.js different large refactorings (subdirectores, removed obsolete stuff) and 2020-08-31 21:25:41 +02:00

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 git@github.com:jhohlfeld/round10.git
$ cd round10
$ npm install

Test using mocha:

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