Here you can find the source of truncate(double value, int truncation)
public static double truncate(double value, int truncation)
//package com.java2s; //License from project: LGPL public class Main { public static double truncate(double value, int truncation) { return Math.floor(value * truncation) / truncation; }//from ww w .j av a 2 s.c om }