久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='AzZOk'></tfoot>

  • <small id='AzZOk'></small><noframes id='AzZOk'>

  • <i id='AzZOk'><tr id='AzZOk'><dt id='AzZOk'><q id='AzZOk'><span id='AzZOk'><b id='AzZOk'><form id='AzZOk'><ins id='AzZOk'></ins><ul id='AzZOk'></ul><sub id='AzZOk'></sub></form><legend id='AzZOk'></legend><bdo id='AzZOk'><pre id='AzZOk'><center id='AzZOk'></center></pre></bdo></b><th id='AzZOk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AzZOk'><tfoot id='AzZOk'></tfoot><dl id='AzZOk'><fieldset id='AzZOk'></fieldset></dl></div>

      <bdo id='AzZOk'></bdo><ul id='AzZOk'></ul>

    1. <legend id='AzZOk'><style id='AzZOk'><dir id='AzZOk'><q id='AzZOk'></q></dir></style></legend>

        Number().toLocaleString() 在不同的瀏覽器中有不同的格

        Number().toLocaleString() has different format in different browsers(Number().toLocaleString() 在不同的瀏覽器中有不同的格式)

        <i id='5mp7y'><tr id='5mp7y'><dt id='5mp7y'><q id='5mp7y'><span id='5mp7y'><b id='5mp7y'><form id='5mp7y'><ins id='5mp7y'></ins><ul id='5mp7y'></ul><sub id='5mp7y'></sub></form><legend id='5mp7y'></legend><bdo id='5mp7y'><pre id='5mp7y'><center id='5mp7y'></center></pre></bdo></b><th id='5mp7y'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5mp7y'><tfoot id='5mp7y'></tfoot><dl id='5mp7y'><fieldset id='5mp7y'></fieldset></dl></div>
      1. <small id='5mp7y'></small><noframes id='5mp7y'>

        • <legend id='5mp7y'><style id='5mp7y'><dir id='5mp7y'><q id='5mp7y'></q></dir></style></legend>
              <tbody id='5mp7y'></tbody>

                  <bdo id='5mp7y'></bdo><ul id='5mp7y'></ul>
                  <tfoot id='5mp7y'></tfoot>

                • 本文介紹了Number().toLocaleString() 在不同的瀏覽器中有不同的格式的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我將浮點數格式化為語言環境字符串(歐元),每個瀏覽器中的結果都大不相同.沒有自己的功能可以修復嗎?

                  I format a float to a locale string (Euro) and there are very different results in every browser. Is it possible to fix without an own function?

                  var sum=2282.0000;
                  var formated_sum = Number(sum.toFixed(2)).toLocaleString("de-DE", {style: "currency", currency: "EUR"});
                  

                  Firefox 結果:2.282,00 €

                  Firefox result: 2.282,00 €

                  Chrome 結果:2.282 €

                  Chrome result: 2.282 €

                  IE 結果:2.282,00 €

                  IE result: 2.282,00 €

                  Safari 結果:2282 歐元

                  Safari result: 2282 €

                  Safari 的結果非常錯誤,chrome 的結果并沒有那么糟糕.任何想法如何在不編寫自己的格式化函數的情況下解決這個問題?

                  Safari results are very much wrong, chrome results are not so much bad. Any Idea how to fix that without writing an own function for formatting?

                  這個問題在這里可能已經有了答案:toLocaleString() 在不同瀏覽器中的行為不一致不,我的問題不同,因為我正在尋找貨幣的解決方案,而不是日期

                  This question may already have an answer here: Inconsistent behavior of toLocaleString() in different browser No, my question is different because i am searching for a solution for Currency, not DATE

                  推薦答案

                  ECMA 262 指定函數依賴于實現并且不帶參數.

                  ECMA 262 specifies that the function is implementation dependent and takes no arguments.

                  產生一個字符串值,表示此數字值格式化根據宿主環境當前語言環境的約定.這個函數是依賴于實現的,它是允許的,但是不鼓勵,因為它返回與 toString 相同的東西.

                  Produces a String value that represents this Number value formatted according to the conventions of the host environment’s current locale. This function is implementation-dependent, and it is permissible, but not encouraged, for it to return the same thing as toString.

                  注意此函數的第一個參數可能用于本標準的未來版本;建議實現不會將此參數位置用于其他任何事情.

                  NOTE The first parameter to this function is likely to be used in a future version of this standard; it is recommended that implementations do not use this parameter position for anything else.

                  它也在 ECMA 國際化 API 規范中(其中Number.prototype.toLocaleString 取代 ECMA 262 但接受 2 個參數)

                  It is also in ECMA internationalization API specification (which for Number.prototype.toLocaleString supersedes ECMA 262 but accepts 2 arguments)

                  此定義取代 ES5 15.7.4.3 中提供的定義.

                  This definition supersedes the definition provided in ES5, 15.7.4.3.

                  當使用可選參數調用 toLocaleString 方法時語言環境和選項,采取以下步驟:

                  When the toLocaleString method is called with optional arguments locales and options, the following steps are taken:

                  讓 x 是這個 Number 值(在 ES5, 15.7.4 中定義).如果語言環境是未提供,則讓語言環境未定義.如果選項不是提供,然后讓選項未定義.讓 numberFormat 為創建一個新對象的結果,就像通過表達式 newIntl.NumberFormat(locales, options) 其中 Intl.NumberFormat 是11.1.3 中定義的標準內置構造函數.返回結果調用 FormatNumber 抽象操作(在 11.3.2 中定義)參數 numberFormat 和 x.長度屬性的值toLocaleString 方法為 0.

                  Let x be this Number value (as defined in ES5, 15.7.4). If locales is not provided, then let locales be undefined. If options is not provided, then let options be undefined. Let numberFormat be the result of creating a new object as if by the expression new Intl.NumberFormat(locales, options) where Intl.NumberFormat is the standard built-in constructor defined in 11.1.3. Return the result of calling the FormatNumber abstract operation (defined in 11.3.2) with arguments numberFormat and x. The value of the length property of the toLocaleString method is 0.

                  此外,mdn指定 Safari 不支持它.

                  Besides, mdn specifies that Safari has no support for it.

                  至于可行的解決方案,請參閱this answer on SO

                  As for a viable solution see this answer on SO

                  這篇關于Number().toLocaleString() 在不同的瀏覽器中有不同的格式的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                  Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)
                    <i id='AKyGX'><tr id='AKyGX'><dt id='AKyGX'><q id='AKyGX'><span id='AKyGX'><b id='AKyGX'><form id='AKyGX'><ins id='AKyGX'></ins><ul id='AKyGX'></ul><sub id='AKyGX'></sub></form><legend id='AKyGX'></legend><bdo id='AKyGX'><pre id='AKyGX'><center id='AKyGX'></center></pre></bdo></b><th id='AKyGX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AKyGX'><tfoot id='AKyGX'></tfoot><dl id='AKyGX'><fieldset id='AKyGX'></fieldset></dl></div>
                      <tbody id='AKyGX'></tbody>

                      <tfoot id='AKyGX'></tfoot>
                      <legend id='AKyGX'><style id='AKyGX'><dir id='AKyGX'><q id='AKyGX'></q></dir></style></legend>

                        • <bdo id='AKyGX'></bdo><ul id='AKyGX'></ul>

                            <small id='AKyGX'></small><noframes id='AKyGX'>

                            主站蜘蛛池模板: 一级毛片免费视频 | 国产视频二区 | 99久久夜色精品国产亚洲96 | 精品久久ai电影 | 久久成人综合 | 99精品一级欧美片免费播放 | 久久久区 | 羞羞在线视频 | 精精国产xxxx视频在线播放7 | 91直接看| 国产一区二区高清在线 | 亚洲国产高清高潮精品美女 | 成年人网站免费 | 久久精品国产一区二区电影 | 国产精品福利视频 | 欧美日韩不卡 | 在线观看亚洲 | 毛片在线看看 | 精品久久久久一区二区国产 | 天天操天天射综合 | www.jizzjizz | 国产日韩欧美另类 | 亚洲精品免费视频 | 久久免费精品视频 | 一区二区三区国产好 | 亚洲劲爆av| 亚洲综合一区二区三区 | 日本黄色免费视频 | 毛片大全| 91久久综合| 欧美美女二区 | 中文字幕一区在线 | 蜜桃av鲁一鲁一鲁一鲁 | 亚洲欧美在线视频 | 日韩一区二区三区av | 亚洲国产自产 | 奇米在线| 九九热最新地址 | 91九色婷婷 | 成人国产精品免费观看视频 | 国产一区在线看 |