JavaScript或JQuery中NumberFormat的等价物是什么? [英] What is the equivalent of NumberFormat in JavaScript or JQuery?

查看:105
本文介绍了JavaScript或JQuery中NumberFormat的等价物是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Java中使用formatter作为我的double值,如:

I use formatter for my double values in Java like:

private static final NumberFormat formatter = new DecimalFormat("###0.00");
formatter.format(doubleValue);

但是我不想在服务器端这样做。如何在Javascript或JQuery中编写等效代码?

However I don't want to do it on the server side. How can I write an equivalent code in Javascript or JQuery?

推荐答案

使用 NumberFormatter 插件。

Use the NumberFormatter plug-in for JQuery.

仅供参考:原来的链接是这里

FYI: the old link was here.

这篇关于JavaScript或JQuery中NumberFormat的等价物是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆