Here you can find the source of roundDown(double amt, double digits)
public static double roundDown(double amt, double digits)
//package com.java2s; //License from project: Apache License public class Main { public static double roundDown(double amt, double digits) { double powValue = Math.pow(10, digits); amt = amt * powValue;//w w w . ja va 2s . com amt = ((int) amt); amt = amt / powValue; return amt; } }