Java Locale Format formatDouble(double in)

Here you can find the source of formatDouble(double in)

Description

format Double

License

Open Source License

Declaration

static Double formatDouble(double in) 

Method Source Code


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

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;

public class Main {
    private static DecimalFormat doubleFormat = new DecimalFormat("#.##", new DecimalFormatSymbols(Locale.ENGLISH));

    static Double formatDouble(double in) {
        return Double.parseDouble(formatDoubleToString(in));
    }/*from   ww  w. ja  v  a  2 s. co m*/

    static String formatDoubleToString(double in) {
        return doubleFormat.format(in);
    }
}

Related

  1. formatDateTime(final Date date)
  2. formatDateTime(java.util.Date date, String format, String locale, String timeZone)
  3. formatDateToSQLString(Date srcDate)
  4. formatDecimal(BigInteger b)
  5. formatDecimalDisplay(final double _numberToFormat, final String _formatToApply)
  6. formatDouble(double inVal, int inDecs)
  7. formatDouble(Double localDouble, int scale)
  8. formatDouble(double number)
  9. formatDouble(double v)