Home  >  Article  >  Web Front-end  >  js amount number formatting implementation code (adding and subtracting commas)_javascript skills

js amount number formatting implementation code (adding and subtracting commas)_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:53:491235browse

例1,使数字1111111变成11,111,111.00,保留两位小数。

复制代码 代码如下:











在线运行:


[Ctrl A 全选 注:如需引入外部Js需刷新才能执行
]


例2,使数字1111111变成11,111,111---和使11,111,111变成1111111---整数--

 

代码如下:





js 格式化金额的代码---www.jb51.net










运行测试:
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn