Here you can find the source of formatPrice(double price, String style)
public static String formatPrice(double price, String style)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String formatPrice(double price, String style) { NumberFormat nf = new DecimalFormat(style); return nf.format(price); }// w w w.j a va 2 s . com public static String format(final Date date) { if (date == null) { return ""; } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // sdf.setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(date); } }