yzf-number-format
v1.0.0
Published
数字格式化
Downloads
8
Maintainers
Readme
完整压缩版-欢迎使用(3.26 kB)
** 版权属于[email protected]
NFormat(value, format)数字Filter
// const aa = NFormat(122121.221, '0'); // 取整,不要小数
// NFormat('122121.221', '0,0') 整数使用3位英文逗号分隔 => 122,121
// NFormat('122121.221', '0,0.00') => 122,121.22
// NFormat('122121.221', '0.00z') => "一十二万二千一百二十一点二二"
// NFormat('122121.221', '0.00k') => 122.12千
// NFormat('122121.221', '0.00w') => 12.21万
// NFormat('122121.221', '0.00m') => 0.12百万
// NFormat('122121.221', '0.00b') => 0.00十亿
// NFormat('+122121.221', '0.00%') => "+12212122.10%"
// NFormat('122121.221', '0,0.00%') => "12,212,122.10%"