java - Round double value to 2 decimal digits -


i have been working big numbers (with more 20 digits) , reason use double . form numbers 8.653762536765e28. want display first 2 decimal digits. want 8.65e28.

i tried find formatting double values wan't able it. result getting 86537...12312.00 .

what thing approach case? how can manage digits in front of e (the base) , not whole number?

i think want achieve:

 double d = 8.653762536765e28;  decimalformat df = new decimalformat("0.00e0");  system.out.print(df.format(d)); 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -