开发者

Jquery - need help on numberformatting for amounts

开发者 https://www.devze.com 2023-03-25 13:20 出处:网络
I\'m trying to use the numberformatter plugin for jQuery. It works, but I don\'t get the right format... I looked at the documentation, but I\'m struggling.

I'm trying to use the numberformatter plugin for jQuery.

It works, but I don't get the right format... I looked at the documentation, but I'm struggling.

I think there is开发者_如何学Go no BE for the Belgium format in the international list.

I tried and played below code and played with # and 0.

$('input[name$=txtTotal]').blur(function () { $(this).format({ format: " #.###,00", locale:"be" }); });
$('input[name$=txtTotal]').blur(function () { $(this).format({ format: " #.###,00"}); });

This is what I want: a comma for decimals separator and a dot for thousand separator and 2 decimals after comma.

input 420000 should be shown 42.000,00 input 1234,56 should be shown 1.234,56 input 123456,78 should be shown 123.456,78


Try the following:

$('input[name$=txtTotal]').blur(function () { $(this).format({ format: "#,###.00", locale:"de" }); })

In the documentation, ',' always means separator and '.' always means decimal separator. The 'de' local should plug in the appropriate values.


Try using the "de" locale. It looks like you should get the same output

0

精彩评论

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