Big decimal setScale gives different value some times

前端 未结 0 1370
别那么骄傲
别那么骄傲 2021-01-07 15:55

I am trying to limit my Amount fields to 4 decimal points by using below,

String val = new BigDecimal(amt).setScale(4,RoundingMode.HALF_UP).toString()

相关标签:
回答
  • 消灭零回复
提交回复
热议问题