有没有一种简单的方法可以在 JavaScript 中格式化数字,类似于 C#(或 VB.NET)中可用的格式化方法ToString("format_provider")
or String.Format()
?
一般来说
- 在 JavaScript 中设置数字格式 http://www.mredkj.com/javascript/numberFormat.html
- 设置数字格式以显示货币等。 https://web.archive.org/web/20200221092535/http://geekswithblogs.net:80/rajeshatdotnet/archive/2008/04/05/121058.aspx
在 jQuery 中
-
自动数字 https://www.decorplanit.com/plugin/(一个不错的数字格式化程序和输入助手,支持 jQuery 1.5+ 的区域设置)
-
jQuery 格式 https://www.asual.com/jquery/format/(Java 的客户端实现简单日期格式 https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html and 数字格式 https://docs.oracle.com/javase/7/docs/api/java/text/NumberFormat.html)
- jquery-numberformatter(支持区域设置的数字格式化程序) https://web.archive.org/web/20160116234619/https://code.google.com/p/jquery-numberformatter/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)