Java Decimal Format toParse(double d)

Here you can find the source of toParse(double d)

Description

to Parse

License

Open Source License

Declaration

public static double toParse(double d) 

Method Source Code


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

import java.text.DecimalFormat;
import java.text.NumberFormat;

import java.util.Locale;

public class Main {
    public static double toParse(double d) {
        double resultado;
        Locale locale = new Locale("en", "UK");
        String pattern = "###.##";

        DecimalFormat decimalFormat = (DecimalFormat) NumberFormat.getNumberInstance(locale);
        decimalFormat.applyPattern(pattern);

        String format = decimalFormat.format(d);
        resultado = Double.parseDouble(format);
        return resultado;
    }//  w  w w .  j  a va 2 s. c o  m
}

Related

  1. toDoubOriginOutPut(double d, int digitally)
  2. toEdmDouble(double value)
  3. toFix(double x, int dp)
  4. toFixedString(Locale locale, double value, int precision)
  5. toFmtDoubleStr(String doubleStr)
  6. toPrecision(double I, int digits1, int digits2)
  7. toScientific(double I, int digits)
  8. toSplitDecimalString(Double num, int decimal)
  9. toStockPrice(double value)