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

so-round

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

so-round

Dealing with JavaScript's numerical problems

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

round-js

Dealing with JavaScript's round problem

why use round-js

when we want to round a number with float, something will go that doesn't what we expect if use Number.toFixed. Consider the situation below:

10.145.toFixed(2) --> 10.14

the equation will return 10.14, but what we expect is 10.15.

how to use round-js

npm install --save so-round

in file

import round from 'so-round'
round(10.145,2) ---> 10.15

more detail can be inspect from test/round.test.js

Keywords

JavaScript

FAQs

Package last updated on 08 Nov 2017

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