Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static double round(double value, int places){
- if(places < 0) throw new IllegalArgumentException();
- BigDecimal bd = new BigDecimal(value);
- bd = bd.setScale(place, RoundingMode.HALF_UP);
- return bd.doubleValue();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement