1. Numeral.js is a JS library for formatting and digital arithmetic.
2. Support multiple languages, including Chinese in 17 languages.
Reference the JS file in the browser:
<script src= "Numeral.min.js" ></script>
<script src= "//cdnjs.cloudflare.com/ajax/libs/numeral.js/1.4.5/numeral.min.js" ></script>
Development of reference development numeral library in Nodejs
NPM Install numeral
var numeral = require (' numeral ');
Formatting types: Numbers can be formatted as currency, percent, time, even decimal, thousand, and abbreviated formats
The formatting method is simple, such as:
1, can operate arithmetic
var number = numeral (+), var added = Number.add (10);//1010
2. Format thousands of bits
var number = numeral (+), var string = Number.format (' 0,0 ');//' $ ' var = number.value ();//1000
Original: Numeral.js
Numeral.js is a JS library for formatting and digital arithmetic