Here you can find the source of roundOffToTwoDecimal(double value)
public static double roundOffToTwoDecimal(double value)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { public static double roundOffToTwoDecimal(double value) { DecimalFormat df = new DecimalFormat("0.00"); return new Double(df.format(value)); }/*w ww .j a v a 2 s. co m*/ }