Java Fraction Format formatDouble(Double doubleValue)

Here you can find the source of formatDouble(Double doubleValue)

Description

Converts Double to string leaving 2 decimal points

License

Open Source License

Parameter

Parameter Description
doubleValue double number to convert

Return

formatted string

Declaration

public static String formatDouble(Double doubleValue) 

Method Source Code

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

import java.text.DecimalFormat;

public class Main {
    /**//w  w  w .j av a  2  s.c  o m
     * Converts Double to string leaving 2 decimal points
     *
     * @param doubleValue double number to convert
     * @return formatted string
     */
    public static String formatDouble(Double doubleValue) {
        return new DecimalFormat("#,##0.00").format(doubleValue);
    }
}

Related

  1. formatDouble(Double d)
  2. formatDouble(double d)
  3. formatDouble(Double d)
  4. formatDouble(double d, int maximumFractionDigits)
  5. formatDouble(Double d, NumberFormat format)
  6. formatDouble(Double in)
  7. formatDouble(double inVal, int inNumPlaces, boolean pad)
  8. formatDouble(Double num)
  9. formatDouble(double num)