Comparing version 4.0.0 to 4.1.0
@@ -8,3 +8,3 @@ declare const roundTo: { | ||
@param number - Number to adjust. | ||
@param precision - (Integer) Number of decimal places. | ||
@param precision - (Integer or Infinity) Number of decimal places. | ||
@@ -28,3 +28,3 @@ @example | ||
@param number - Number to adjust. | ||
@param precision - (Integer) number of decimal places. | ||
@param precision - (Integer or Infinity) number of decimal places. | ||
@@ -45,3 +45,3 @@ @example | ||
@param number - Number to adjust. | ||
@param precision - (Integer) number of decimal places. | ||
@param precision - (Integer or Infinity) number of decimal places. | ||
@@ -48,0 +48,0 @@ @example |
@@ -8,2 +8,6 @@ 'use strict'; | ||
if (precision === Infinity) { | ||
return number; | ||
} | ||
if (!Number.isInteger(precision)) { | ||
@@ -10,0 +14,0 @@ throw new TypeError('Expected precision to be an integer'); |
{ | ||
"name": "round-to", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Round a number to a specific number of decimal places: `1.234` → `1.2`", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -35,2 +35,9 @@ # round-to [![Build Status](https://travis-ci.org/sindresorhus/round-to.svg?branch=master)](https://travis-ci.org/sindresorhus/round-to) | ||
Specifying an infinite `precision` will assume infinite decimal places. | ||
```js | ||
roundTo(0.1231782638, Infinity); | ||
//=> 0.1231782638 | ||
``` | ||
## API | ||
@@ -58,3 +65,3 @@ | ||
Type: `number` (Integer) | ||
Type: `number` (Integer or Infinity) | ||
@@ -61,0 +68,0 @@ Number of decimal places. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5526
70
72