格式化
将toFormat实例方法添加到或 。
安装
节点.js
$ npm install toformat
浏览器
< script src =' path/to/big.js ' > </ script >
< script src =' path/to/toFormat.js ' > </ script >
用
节点.js
Big = require ( 'big' )
Big = require ( 'toformat' ) ( Big )
x = new Big ( 9876.54321 )
x . toFormat ( 2 ) // '9,876.54'
// Three different ways of setting a formatting property
Big . format . decimalSepara
1