At least Double.parseDouble accepts both
System.out.println(Double.parseDouble("6.543e-4")); System.out.println(Double.parseDouble("6.543E-4"));
Output
6.543E-4 6.543E-4
as for NumberFormat, we can change E to e as
DecimalFormat nf = (DecimalFormat)NumberFormat.getNumberInstance(); DecimalFormatSymbols s = new DecimalFormatSymbols(); s.setExponentSeparator("e"); nf.setDecimalFormatSymbols(s); System.out.println(nf.parse("6,543e-4"));
Output
6.543E-4
but now it does not accept E :(
source share