I need to return BigDecimal in this format (%.##) For example i have this floating number
3.2->3.20
6.2->6.20
112.0->112.00
I'm trying this
BigDecimal precoDecial = new BigDecimal(preco);
precoDecial.setScale(2, BigDecimal.ROUND_HALF_UP);
But it is not working for me; this returns:
for:
3.2->3.2000000476837158203125
6.2->6.2