Java Number Format Pattern format(Object price)

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

Description

format

License

Open Source License

Declaration

public static String format(Object 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  w ww . ja va  2 s  .  c  o m

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

Related

  1. format(long bytes)
  2. format(long value)
  3. format(Number value)
  4. format(Number value)
  5. format(Object num, int dev, String valueIfZero)
  6. format(String str_number, int digits)
  7. format(String value)
  8. formatAmtByComma(String amt, int len)
  9. formatBigNumber(long value)