Here you can find the source of RoundHalfUp(double d)
public static double RoundHalfUp(double d)
//package com.java2s; public class Main { public static double RoundHalfUp(double d) { return .5 * Math.ceil(d / .5); //BigDecimal value = new BigDecimal(d); //value.setScale(1, RoundingMode.HALF_UP); //return value.doubleValue(); }/* w w w.j av a2s. c o m*/ }