Java Utililty Methods Parse Double

List of utility methods to do Parse Double

Description

The list of methods to do Parse Double are organized into topic(s).

Method

doubleparseDoubleInCurrentDefaultLocale(String text)
parse Double In Current Default Locale
java.text.ParsePosition parsePosition = new java.text.ParsePosition(0);
Number number = java.text.NumberFormat.getNumberInstance().parse(text, parsePosition);
if ((number != null) && (parsePosition.getIndex() == text.length())) {
    return number.doubleValue();
} else {
    return Double.NaN;
floatparseInternationalDouble(String number)
parse a string and return the corresponding double value, it accepts comma or point as decimal separator
NumberFormat nffrench = NumberFormat.getInstance(Locale.FRENCH);
NumberFormat nfus = NumberFormat.getInstance(Locale.US);
Number numberToReturn = number.indexOf(',') != -1 ? nffrench.parse(number) : nfus.parse(number);
return numberToReturn.floatValue();
StringparseToCientificNotation(double value)
parse To Cientific Notation
DecimalFormat formatter = new DecimalFormat("0.00E00");
return formatter.format(value).toLowerCase();
StringparseToEngineeringNotation(double val, int decimalHouses)
parse To Engineering Notation
DecimalFormat engNot = new DecimalFormat("##0.###E0");
String pl = engNot.format(val);
String[] pl2 = pl.split("E");
double vl = Double.parseDouble(pl2[0].replace(',', '.'));
vl = round(vl, decimalHouses);
int mul = Integer.parseInt(pl2[1]);
String mulStr = "";
switch (mul) {
...
DoubleparseYuanToYi(Double data)
parse Yuan To Yi
if (data != null) {
    NumberFormat nf = new DecimalFormat("0.00");
    String tmp = nf.format(data / 100000000);
    return Double.valueOf(tmp);
return data;