Here you can find the source of format(Object price)
public static String format(Object price)
//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); } }