【问题标题】:Format currency with dot instead of comma using i18n使用 i18n 用点而不是逗号格式化货币
【发布时间】:2019-10-30 09:09:51
【问题描述】:

我们使用 java.text.NumberFormat 类使用 getInstance(Locale paramLocale) 方法格式化货币值。我们的问题是当我们传递 es_CO(Columbia) 语言代码时,它会自动将其格式化为值 123,00 而不是 123.00。有没有办法用点而不是逗号来格式化? 我正在使用 Spring 平台(hybris)

请注意,由于业务原因,我无法更改语言环境。

【问题讨论】:

    标签: spring internationalization hybris


    【解决方案1】:

    您可以使用DecimalFormat 来拥有自己的格式。 看看这个How can I format a String number to have commas and round?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-11
      • 2022-01-07
      • 2023-02-17
      • 2011-12-04
      相关资源
      最近更新 更多