 |
round double to two decimal places in java - Stack Overflow
ok this is what I did to round a double to 2 decimal places, amount = roundTwoDecimals(amount); public double roundTwoDecimals(double d) { DecimalFormat twoDForm = new DecimalFormat("#.##"); ... ... Your Money class could be represented as a subclass of .
stackoverflow.com |
 |