Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

round-to

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

round-to - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

6

index.d.ts

@@ -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.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc