DecimalFormat and Double.valueOf()

后端 未结 10 1285
鱼传尺愫
鱼传尺愫 2020-12-24 15:22

I\'m trying to get rid of unnecessary symbols after decimal seperator of my double value. I\'m doing it this way:

DecimalFormat format = new DecimalFormat(\"         


        
10条回答
  •  南笙
    南笙 (楼主)
    2020-12-24 16:10

    Use Locale.getDefault() to get your system's decimal separator which you can also set. You can't have two different separators at the same time since the other is then usually used as the separator for thousands: 2.001.000,23 <=> 2,001,000.23

提交回复
热议问题