Java Fraction Format format(double price)

Here you can find the source of format(double price)

Description

format

License

Open Source License

Declaration

public static String format(double price) 

Method Source Code


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

import java.text.DecimalFormat;

public class Main {
    public static String format(double price) {
        DecimalFormat formatter = new DecimalFormat("###,###,##0.00");
        return formatter.format(price);
    }/*from ww  w. j a  v  a2  s  . c om*/

    public static String format(Object price) {
        DecimalFormat formatter = new DecimalFormat("###,###,##0.00");
        return formatter.format(price);
    }
}

Related

  1. format(double number)
  2. format(double number)
  3. format(double number)
  4. format(double number, int digits)
  5. format(double number, String fmt)
  6. format(double val)
  7. format(double val)
  8. format(double val)
  9. format(double value)