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

fixfloat

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fixfloat

fix float number bug or round float number

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

fixfloat

npm npm GitHub license

You can use it to fix the float-number bug in javascript.

const fixfloat = require('fixfloat');

const floatNumber = 0.1 + 0.2; // 0.30000000000000004

fixfloat(floatNumber); // 0.3

You can also use it to round your number.

const fixfloat = require('fixfloat');

const floatNumber = 3456.3456;

fixfloat(floatNumber); // 3456.3
fixfloat(floatNumber, 2); // 3456.35
fixfloat(floatNumber, 1); // 3456.3
fixfloat(floatNumber, 0); // 3456
fixfloat(floatNumber, -1); // 3460
fixfloat(floatNumber, -3); // 3000

Install

npm install fixfloat --save

Keywords

fix

FAQs

Package last updated on 13 Aug 2019

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