Here you can find the source of roundDown(double num)
public static double roundDown(double num)
//package com.java2s; //License from project: Apache License public class Main { public static double roundDown(double num) { return Double.valueOf(String.format("%.2f", num)); // return new BigDecimal(num).setScale(2, // BigDecimal.ROUND_HALF_UP).doubleValue(); }//w w w . ja v a2 s.c o m }