本文介紹了Javascript toFixed 本地化?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
你知道 toFixed 是不是本地化函數(shù)嗎?
Do you know if toFixed is a localized function?
我的意思是,會(huì)這樣嗎:
I mean, will this:
var n = 100.67287;
alert(n.toFixed(2));
在英文美國操作系統(tǒng)/瀏覽器上顯示100.67"和意大利操作系統(tǒng)/瀏覽器上的100,67"(帶逗號)?(意大利語或任何其他使用逗號作為小數(shù)分隔符的本地系統(tǒng)).
show "100.67" on english US OS/browsers and "100,67" (with comma) on Italian OS/browsers? (Italian or any other local system that uses comma as decimal separator).
謝謝!
推薦答案
不,這總是會(huì)返回一個(gè)點(diǎn).ECMA 262-spec [15.7.4.5] 指出這應(yīng)該是一個(gè)觀點(diǎn).
No, this will always return a point. The ECMA 262-spec [15.7.4.5] states it should be a point.
這篇關(guān)于Javascript toFixed 本地化?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!