https://github.com/bendrucker/round-precision
Round a number to a specified decimal precision
https://github.com/bendrucker/round-precision
Last synced: 11 months ago
JSON representation
Round a number to a specified decimal precision
- Host: GitHub
- URL: https://github.com/bendrucker/round-precision
- Owner: bendrucker
- License: mit
- Created: 2015-06-18T14:46:26.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T21:41:30.000Z (almost 7 years ago)
- Last Synced: 2025-04-15T00:03:42.568Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# round-precision [](https://travis-ci.org/bendrucker/round-precision) [](https://greenkeeper.io/)
> Round a number to a specified decimal precision
## Install
```
$ npm install --save round-precision
```
## Usage
```js
var roundPrecision = require('round-precision')
roundPrecision(12.34, 1)
//=> 12.3
```
## API
#### `roundPrecision(value, places)` -> `number`
##### value
*Required*
Type: `number`
A finite number to round.
##### value
*Required*
Type: `number`
A non-negative number of integer places.
## License
MIT © [Ben Drucker](http://bendrucker.me)