Here you can find the source of formatDouble(double d)
public static double formatDouble(double d)
//package com.java2s; //License from project: LGPL public class Main { public static double formatDouble(double d) { return (double) Math.round(d * 100) / 100; }//from w ww .j av a 2 s. c om }