Java tutorial
//package com.java2s; import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static double round(double num) { BigDecimal b = new BigDecimal(num); BigDecimal rounded = b.setScale(2, RoundingMode.HALF_EVEN); return rounded.doubleValue(); //return num; } }