【问题标题】:Why does Android's NumberFormat use a comma as a decimal separator for Australia?为什么 Android 的 NumberFormat 使用逗号作为澳大利亚的小数分隔符?
【发布时间】:2019-07-28 20:23:31
【问题描述】:

使用android.icu.text.NumberFormat 类:

NumberFormat numberFormat =  NumberFormat.getNumberInstance(Locale("en", "AU")); 
numberFormat.isGroupingUsed = true
String number = numberFormat.format(123456)

会产生123,456,但根据Wikipedia,澳大利亚使用点.作为小数分隔符。为什么 NumberFormat 会这样?

【问题讨论】:

    标签: java android locale number-formatting


    【解决方案1】:

    数字123456 没有小数。您看到的是千位分组符号 ,,而不是小数点。

    【讨论】:

    • 糟糕。这有点尴尬 :D 谢谢。
    猜你喜欢
    • 2014-03-16
    • 2013-11-03
    • 2012-09-05
    • 2014-07-16
    • 1970-01-01
    • 2016-07-09
    • 2016-02-10
    • 1970-01-01
    • 2012-06-16
    相关资源
    最近更新 更多