List of utility methods to do Parse Double
double | parseDoubleInCurrentDefaultLocale(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; |
float | parseInternationalDouble(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(); |
String | parseToCientificNotation(double value) parse To Cientific Notation DecimalFormat formatter = new DecimalFormat("0.00E00"); return formatter.format(value).toLowerCase(); |
String | parseToEngineeringNotation(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) { ... |
Double | parseYuanToYi(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; |