开发者

Formatting a Number in JQuery

开发者 https://www.devze.com 2023-02-08 01:47 出处:网络
I have following method in Javascript for formatting a number and get output as - $250.00 formatNumber(Math.round((finalTotal开发者_运维问答 - parseFloat(SellerAmtNoFormat)) * 100) / 100, \"$###,###,

I have following method in Javascript for formatting a number and get output as - $250.00

formatNumber(Math.round((finalTotal开发者_运维问答 - parseFloat(SellerAmtNoFormat)) * 100) / 100, "$###,###,###,##0.00");   

Can anyone please suggest the equivalent in jQuery?


JQuery consists entirely of javascript. So you example line above will work exactly the same in jQuery.

If there was a problem with the above code, what was the exact problem?


formatNumber(Math.round((finalTotal - parseFloat(SellerAmtNoFormat)) * 100) / 100, "$###,###,###,##0.00");   

There!


Take a look at the jQuery NumberFormatter plugin.

0

精彩评论

暂无评论...
验证码 换一张
取 消