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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -

python - Read npy file directly from S3 StreamingBody -