New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

round-intervals

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

round-intervals

Round a number to the closest interval.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

round-intervals

Round a number to the closest interval.

Install

npm install round-intervals

Usage

import roundIntervals, {roundIntervalsUp, roundIntervalsDown} from 'round-intervals';

roundIntervals(1, 5);
//=> 0

roundIntervals(4, 5);
//=> 5

roundIntervals(8, 5);
//=> 10

roundIntervalsUp(1, 5);
//=> 5

roundIntervalsUp(4, 5);
//=> 5

roundIntervalsDown(1, 5);
//=> 0

roundIntervalsDown(4, 5);
//=> 0

API

roundIntervals(number, intervals)

Round number to the nearest interval.

roundIntervalsUp(number, intervals)

Round number up to the nearest interval.

roundIntervalsDown(number, intervals)

Round number down to the nearest interval.

number

Type: number

The number to round.

intervals

Type: number

The intervals to round to.

Keywords

math

FAQs

Package last updated on 05 Sep 2021

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