
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
number-formatierer
Advanced tools
npm install --save number-formatierer
or
yarn add number-formatierer
var numberFormat = require('number-formatierer')
//import numberFormat from 'number-formatierer' ES6
numberFormat("-12.0000") // "-12"
numberFormat(120000) // "120,000"
numberFormat(-120000, 2) // "-120,000.00"
numberFormat(131277.092213, 2, 3) // "131,277.09"
numberFormat(131277.092213, 2, 3, "#") // "131#277.09"
numberFormat(131277.092213, 2, 3, "#","|") // "131#277|09"
Parameters:
Returns:
The numberFormat
function accepts these same parameters as the second and third params. This prevents using currying to bind them and reuse that bound function.
The bindWith
function accepts the options and returns a function bound with them.
var numberFormat = require('number-formatierer')
//import numberFormat from 'number-formatierer' ES6
const _bindWith = numberFormat.bindWith(2, 4, ",", ".")
_bindWith(131277.092213); // 13,1277.09
same as number.toFixed
and More accurate than number.toFixed
Parameters:
var numberFormat = require('number-formatierer')
//import numberFormat from 'number-formatierer' ES6
numberFormat.toFixed(0.015, 2); // 0.02
numberFormat.toFixed(0.025, 2); // 0.03
numberFormat.toFixed(0.035, 2); // 0.04
numberFormat.toFixed(0.045, 2); // 0.05
(0.015).toFixed(2); //0.01
(0.025).toFixed(2); //0.03
(0.035).toFixed(2); //0.04
(0.045).toFixed(2); //0.04
FAQs
Format a number with commas
The npm package number-formatierer receives a total of 5 weekly downloads. As such, number-formatierer popularity was classified as not popular.
We found that number-formatierer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.