kar*_*thi 0 java numbers number-formatting decimalformat
我正在使用此代码:
DecimalFormat df = new DecimalFormat();
df.setMinimumFractionDigits(2);
df.setMaximumFractionDigits(2);
float a=(float) 15000.345;
Sytem.out.println(df.format(a));
Run Code Online (Sandbox Code Playgroud)
我得到这个输出:15,000.35
我不希望逗号进入此输出.我的输出应该是:15000.35.
在Java中获取此输出的最佳方法是什么?