Java Hour Format formatPrice(double price, String style)

Here you can find the source of formatPrice(double price, String style)

Description

format Price

License

Apache License

Declaration

public static String formatPrice(double price, String style) 

Method Source Code

//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);
    }
}

Related

  1. formatMM(Date date)
  2. formatNanosTimeUSEastern(long nanos)
  3. formatNewDate(String format)
  4. formatOffset(int offset)
  5. formatOptimal(Date d)
  6. formatRawDateTime(int unixtime)
  7. formatRecyclingDate(String strDate)
  8. formatRFC1123(Date date)
  9. formatRfc3339Date(Date date)