問題:哪個JavaScript函數像parsefloat那樣將locale作爲參數?
我得到這個輸入:
"23,234.34"
用以下語言環境,語言環境 = 「美美」
我想這樣的結果:在數量VAR 23234.34
。
因此,我使用parseFloat,但此函數不採取區域設置作爲參數, 當我使用字符串「23,234.34」,函數返回不是數字(NAN)。
if ($('input#feesamount').val() != '') {
$funding = {
feeAmount: parseFloat($('input#feesamount').val()),
acquirerregistrationid: $('input#registerid').val(),
acquirer: $('select#acquirer').val()
};
你知道一個能幫助我的功能嗎?
http://stackoverflow.com/a/12694511/的 – chridam 2014-10-17 09:53:53
可能重複的[JavaScript的parseFloat in Different Cultures](http://stackoverflow.com/questions/12694455/javascript-parsefloat-in-different-cultures) – bitoiu 2014-10-17 09:56:32