jjzjj

DecimalFormatSymbols

全部标签

java - 如何在java中设置自定义货币?

我尝试制作手工货币。这是我的代码DecimalFormatdf=newDecimalFormat();DecimalFormatSymbolsdfs=newDecimalFormatSymbols();dfs.setCurrencySymbol("$");dfs.setGroupingSeparator('.');dfs.setDecimalSeparator('.');df.setDecimalFormatSymbols(dfs);System.out.println(df.format(3333454));程序输出为3.333.454为什么我设置的货币符号没有出现?

java - 带语言环境的 DecimalFormatSymbols

对于下面的代码,当我这样运行它和在Tomcat网络应用程序中运行它时,我得到了不同的结果。publicstaticvoidmain(String[]args){System.out.println(System.getProperty("user.language"));System.out.println(System.getProperty("user.country"));System.out.println(Locale.getDefault(Category.DISPLAY));System.out.println(Locale.getDefault(Category.FOR