Java override locale setting for specific locale

前端 未结 3 1661
野趣味
野趣味 2021-01-18 16:36

I\'m using NumberFormat.getCurrencyInstance().format(amount) to format currency from a BigDecimal to a string. This works as expected the problem is that our ma

3条回答
  •  有刺的猬
    2021-01-18 16:45

    Use the applyPattern method:

    final DecimalFormat df = (DecimalFormat)NumberFormat.getCurrencyInstance(locale);
    df.applyPattern("¤#,##0.##");
    

提交回复
热议问题