New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

round

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

round

Round numbers to the nearest increment with an optional direction

1.0.1
Source
npm
Version published
Weekly downloads
52K
4.88%
Maintainers
1
Weekly downloads
 
Created
Source

round.js

Round numbers to the nearest multiple with an optional direction.

Setup

$ npm install round

API

round(value, multiple, [options]) -> Number

Rounds a number value to the nearest multiple. options (optional) can specify options.direction to 'up' or 'down' to specify the rounding direction. Otherwise, round will choose the nearest direction but default to 'up' if value is equidistant from the rounded values.

round.down(value, multiple) -> Number

Shortcut for calling round with options.direction = 'down'.

round.up(value, multiple) -> Number

Shortcut for calling round with options.direction = 'up'.

Keywords

numbers

FAQs

Package last updated on 10 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts