Java Double Number Format getFormattedTwoDecimal(double d)

Here you can find the source of getFormattedTwoDecimal(double d)

Description

get Formatted Two Decimal

License

Open Source License

Declaration

public static String getFormattedTwoDecimal(double d) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.DecimalFormat;

public class Main {
    public static String getFormattedTwoDecimal(double d) {
        DecimalFormat df = new DecimalFormat("##.##");
        return df.format(d);
    }/*from   w w  w. ja  va  2s  . c  om*/
}

Related

  1. getFormat(double d)
  2. getFormat(double value)
  3. getFormatAmount(Double d)
  4. getFormattedNumber(Double number, int decimals, Locale locale)
  5. getFormattedString(double d, int numDecimalPlaces)
  6. getFormattedValue(double argDoubleValue)
  7. getTwoDecimalByDecimalFormat(double number)
  8. getValidString(Double value, DecimalFormat formatter)
  9. isDoubleWhitFormat(String pValue)