Here you can find the source of getDoubleWithTwoDecimalDigits(double value)
public static double getDoubleWithTwoDecimalDigits(double value)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.Locale; public class Main { public static double getDoubleWithTwoDecimalDigits(double value) { DecimalFormat df = new DecimalFormat("0.00", new DecimalFormatSymbols(Locale.US)); return Double.valueOf(df.format(value)); }//from www.jav a2 s. co m }