I want to round value with 5 decimal place.
I've tried Math.round(x * 10000) / 10000
but it doesn't work.
I want to round value with 5 decimal place.
I've tried Math.round(x * 10000) / 10000
but it doesn't work.
You can try below code for more precious rounding, generally we use these to calculate insurance data:
BigDecimal decimal = new BigDecimal(100);
decimal.round(new BigDecimal(10000).setScale(5,BigDecimal.ROUND_DOWN);
Be careful in choosing the ceiling option. Refer big-decimal for more options.