An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# round-precision [![Build Status](https://travis-ci.org/bendrucker/round-precision.svg?branch=master)](https://travis-ci.org/bendrucker/round-precision) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/round-precision.svg)](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)