How do I convert scientific notation to regular floating value. For example for the value 1.255555555569E10, I want 12555555555.69 as output.
I have tried the following way
Double val = new BigDecimal(1.25E10).doubleValue();
System.out.println(val);
// output : 1.23E10
I tried using long aswell
long val = new BigDecimal(1.25E10).longValueExact();
System.out.println(val);
// output is 12500000000
But long fails if the value has decimal like
long val = new BigDecimal(1.255555555569E10).longValueExact();
System.out.println(val);
// output is 12555555555
instead
// output should be 12555555555.69
please suggest.