What is the equivalent of NumberFormat in JavaScript or JQuery?
问题 I use formatter for my double values in Java like: private static final NumberFormat formatter = new DecimalFormat("###0.00"); formatter.format(doubleValue); However I don't want to do it on the server side. How can I write an equivalent code in Javascript or JQuery? 回答1: Use the NumberFormatter plug-in for JQuery. FYI: the old link was here. 回答2: I know this doesn't really answers your question, but have you thought of using the jstl formatNumber tag? 回答3: Use JSTL <fmt:formatNumber> ...