java - I want to print amount like 2523525252.025 when I using double data type it's changed in 2.523525252025E9 how can fix? -
this question has answer here:
i want print amount 2523525252.025
when using double data type it's changed in 2.523525252025e9
how can fix?
example -
double saleprice=145236.12; int itemqountity=1500; double totalamount= saleprice*itemqountity; log.e("totalamount",""+totalamount);
output-
e/totalamount: 2.1785418e8
please use decimalformat
print value without scientific notation here example.
double test = 12345678; decimalformat df = new decimalformat("#"); df.setmaximumfractiondigits(0); system.out.println(df.format(test)); //12345678
wiki
Comments
Post a Comment