Android examples for java.lang:Double
Round double value to Two Decimals
//package com.java2s; import java.text.DecimalFormat; public class Main { public static double RoundTwoDecimals(double d) { DecimalFormat twoDForm = new DecimalFormat("#.##"); return Double.valueOf(twoDForm.format(d)); }/* w w w . j a v a 2s. c o m*/ }