如何在java中以印度编号格式显示货币

时间:2022-08-13 07:30:29

current amount in UK format using Locale.UK and pattern #,##0.00 - 450,500.00 but i need it in Indian format

使用Locale.UK和## 0.00 - 450,500.00的英国格式的当前金额,但我需要印度格式

2 个解决方案

#1


2  

try ICU4J available from Maven central repo

尝试从Maven central repo获得的ICU4J

    Format format = com.ibm.icu.text.NumberFormat.getNumberInstance(new Locale("en", "IN"));
    String str = format.format(100000000);

output

10,00,00,000

#2


0  

if you dont want to you third party libraries you can try this code as well

如果您不想要第三方库,您也可以尝试使用此代码

Format df = new DecimalFormat("###,###,000.00"); int val = 10000000; System.out.println(df.format(val));

格式df = new DecimalFormat(“###,###,000.00”); int val = 10000000;的System.out.println(df.format(VAL));

#1


2  

try ICU4J available from Maven central repo

尝试从Maven central repo获得的ICU4J

    Format format = com.ibm.icu.text.NumberFormat.getNumberInstance(new Locale("en", "IN"));
    String str = format.format(100000000);

output

10,00,00,000

#2


0  

if you dont want to you third party libraries you can try this code as well

如果您不想要第三方库,您也可以尝试使用此代码

Format df = new DecimalFormat("###,###,000.00"); int val = 10000000; System.out.println(df.format(val));

格式df = new DecimalFormat(“###,###,000.00”); int val = 10000000;的System.out.println(df.format(VAL));