I am using formatCurrency to format currency values.

For example, I am using it to format 1000 into $1.000,00 using:

$(".money").formatCurrency({ region: currencyTypeCode });

I want to perform calculations on these values now. Is there any method in formatCurrency to 'unglobalize' this number from $1.000,00 to 1000.00?

I can write my own function but I wanted to see if I am overlooking some functionality that already existed.

有帮助吗?

解决方案

It looks like toNumber() or asNumber() will do the trick for you. I'm not familiar with the plugin so you'll have to play with it but for "$1.000,00" I'd start with:

toNumber({decimalSymbol: "," , region: currencyTypeCode });

https://code.google.com/p/jquery-formatcurrency/wiki/Usage

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top