Here you can find the source of round(double round, int decimal, int ceilOrFloor)
public static double round(double round, int decimal, int ceilOrFloor)
//package com.java2s; //License from project: Apache License public class Main { public static double round(double round, int decimal, int ceilOrFloor) { round *= (Math.pow(10, decimal)); if (ceilOrFloor == 0) { round = Math.ceil(round); } else {/*from ww w. j a v a 2s . c om*/ round = Math.floor(round); } round /= (Math.pow(10, decimal)); return round; } }