pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="8uceaam" 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="qiywwma" 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() 在不同的瀏覽器中有不同的格式的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我將浮點(diǎn)數(shù)格式化為語(yǔ)言環(huán)境字符串(歐元),每個(gè)瀏覽器中的結(jié)果都大不相同.沒有自己的功能可以修復(fù)嗎?

                  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 結(jié)果:2.282,00 €

                  Firefox result: 2.282,00 €

                  Chrome 結(jié)果:2.282 €

                  Chrome result: 2.282 €

                  IE 結(jié)果:2.282,00 €

                  IE result: 2.282,00 €

                  Safari 結(jié)果:2282 歐元

                  Safari result: 2282 €

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

                  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?

                  這個(gè)問題在這里可能已經(jīng)有了答案:toLocaleString() 在不同瀏覽器中的行為不一致不,我的問題不同,因?yàn)槲艺趯ふ邑泿诺慕鉀Q方案,而不是日期

                  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 指定函數(shù)依賴于實(shí)現(xiàn)并且不帶參數(shù).

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

                  產(chǎn)生一個(gè)字符串值,表示此數(shù)字值格式化根據(jù)宿主環(huán)境當(dāng)前語(yǔ)言環(huán)境的約定.這個(gè)函數(shù)是依賴于實(shí)現(xiàn)的,它是允許的,但是不鼓勵(lì),因?yàn)樗祷嘏c 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.

                  注意此函數(shù)的第一個(gè)參數(shù)可能用于本標(biāo)準(zhǔn)的未來(lái)版本;建議實(shí)現(xiàn)不會(huì)將此參數(shù)位置用于其他任何事情.

                  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 國(guó)際化 API 規(guī)范中(其中Number.prototype.toLocaleString 取代 ECMA 262 但接受 2 個(gè)參數(shù))

                  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.

                  當(dāng)使用可選參數(shù)調(diào)用 toLocaleString 方法時(shí)語(yǔ)言環(huán)境和選項(xiàng),采取以下步驟:

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

                  讓 x 是這個(gè) Number 值(在 ES5, 15.7.4 中定義).如果語(yǔ)言環(huán)境是未提供,則讓語(yǔ)言環(huán)境未定義.如果選項(xiàng)不是提供,然后讓選項(xiàng)未定義.讓 numberFormat 為創(chuàng)建一個(gè)新對(duì)象的結(jié)果,就像通過表達(dá)式 newIntl.NumberFormat(locales, options) 其中 Intl.NumberFormat 是11.1.3 中定義的標(biāo)準(zhǔn)內(nèi)置構(gòu)造函數(shù).返回結(jié)果調(diào)用 FormatNumber 抽象操作(在 11.3.2 中定義)參數(shù) numberFormat 和 x.長(zhǎng)度屬性的值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.

                  至于可行的解決方案,請(qǐng)參閱this answer on SO

                  As for a viable solution see this answer on SO

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

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

                  相關(guān)文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運(yùn)行任務(wù)?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個(gè)接一個(gè)地依次運(yùn)行 Gulp 任務(wù))
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時(shí) Visual Studio 2015 崩潰)
                  Detect FLASH plugin crashes(檢測(cè) 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="kimsqse" 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'>

                            主站蜘蛛池模板: 广州昊至泉水上乐园设备有限公司 | 蓝莓施肥机,智能施肥机,自动施肥机,水肥一体化项目,水肥一体机厂家,小型施肥机,圣大节水,滴灌施工方案,山东圣大节水科技有限公司官网17864474793 | 行业分析:提及郑州火车站附近真有 特殊按摩 ?2025实地踩坑指南 新手如何避坑不踩雷 | 游戏版号转让_游戏资质出售_游戏公司转让-【八九买卖网】 | 智能楼宇-楼宇自控系统-楼宇智能化-楼宇自动化-三水智能化 | 国产液相色谱仪-超高效液相色谱仪厂家-上海伍丰科学仪器有限公司 | 论文查重_免费论文查重_知网学术不端论文查重检测系统入口_论文查重软件 | 蓝米云-专注于高性价比香港/美国VPS云服务器及海外公益型免费虚拟主机 | 361°官方网站 | 撕碎机_轮胎破碎机_粉碎机_回收生产线厂家_东莞华达机械有限公司 | 釜溪印象网络 - Powered by Discuz! | 深圳公司注册-工商注册公司-千百顺代理记账公司 | 天坛家具官网| 水性漆|墙面漆|木器家具漆|水漆涂料_晨阳水漆官网 | 聚丙烯酰胺_厂家_价格-河南唐达净水材料有限公司 | 主题班会网 - 安全教育主题班会,各类主题班会PPT模板 | 双舌接地线-PC68数字式高阻计-ZC36|苏海百科| 贵州自考_贵州自学考试网| 玖容气动液压设备有限公司-气液增压缸_压力机_增压机_铆接机_增压器 | 甲级防雷检测仪-乙级防雷检测仪厂家-上海胜绪电气有限公司 | 网优资讯-为循环资源、大宗商品、工业服务提供资讯与行情分析的数据服务平台 | 海德莱电力(HYDELEY)-无功补偿元器件生产厂家-二十年专业从事电力电容器 | 深圳网站建设-高端企业网站开发-定制网页设计制作公司 | 吉祥新世纪铝塑板_生产铝塑板厂家_铝塑板生产厂家_临沂市兴达铝塑装饰材料有限公司 | 美国查特CHART MVE液氮罐_查特杜瓦瓶_制造全球品质液氮罐 | 北京网站建设首页,做网站选【优站网】,专注北京网站建设,北京网站推广,天津网站建设,天津网站推广,小程序,手机APP的开发。 | 润东方环保空调,冷风机,厂房车间降温设备-20年深圳环保空调生产厂家 | 湖南档案密集架,智能,物证,移动,价格-湖南档案密集架厂家 | 渣油泵,KCB齿轮泵,不锈钢齿轮泵,重油泵,煤焦油泵,泊头市泰邦泵阀制造有限公司 | 气动隔膜泵-电动隔膜泵-循环热水泵-液下排污/螺杆/管道/化工泵「厂家」浙江绿邦 | SMC-ASCO-CKD气缸-FESTO-MAC电磁阀-上海天筹自动化设备官网 | 地磅-地秤-江阴/无锡地磅-江阴天亿计量设备有限公司_ | 河南空气能热水器-洛阳空气能采暖-洛阳太阳能热水工程-洛阳润达高科空气能商行 | 铝镁锰板厂家_进口钛锌板_铝镁锰波浪板_铝镁锰墙面板_铝镁锰屋面-杭州军晟金属建筑材料 | 电镀标牌_电铸标牌_金属标贴_不锈钢标牌厂家_深圳市宝利丰精密科技有限公司 | 纸张环压仪-纸张平滑度仪-杭州纸邦自动化技术有限公司 | 安全,主动,被动,柔性,山体滑坡,sns,钢丝绳,边坡,防护网,护栏网,围栏,栏杆,栅栏,厂家 - 护栏网防护网生产厂家 | 模具硅橡胶,人体硅胶,移印硅胶浆厂家-宏图硅胶科技 | 报警器_家用防盗报警器_烟雾报警器_燃气报警器_防盗报警系统厂家-深圳市刻锐智能科技有限公司 | 红立方品牌应急包/急救包加盟,小成本好项目代理_应急/消防/户外用品加盟_应急好项目加盟_新奇特项目招商 - 中红方宁(北京) 供应链有限公司 | OLChemim试剂-ABsciex耗材-广州市自力色谱科仪有限公司 |