You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Firefox与Chrome中Intl.NumberFormat格式化LBP货币的行为差异

Intl.NumberFormat格式化黎巴嫩镑(LBP)时Firefox与Chrome的行为差异

使用Intl.NumberFormat函数格式化黎巴嫩镑(LBP)时,Firefox和Chrome存在明显行为差异:

执行以下代码:

const options = { style: "currency", currency: "LBP" };
const numberFormat = new Intl.NumberFormat("en-GB", options);
console.log(numberFormat.format(654321.987));
  • 在Firefox中输出结果为:"LBP 654,321.99"
  • 在Chrome中输出结果为:"LBP 654,322"

我想知道这种差异产生的原因,是浏览器的特定设置还是Intl实现细节导致的?

PS:我了解minimumFractionDigits属性,但我的问题更聚焦于这种差异本身——我期望得到与Firefox一致的结果,不理解Chrome为何会直接向上取整到整数。

内容的提问来源于stack exchange,提问作者hchic

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 17:54:56