1

when ever I put a big or small number through System.out.println() (in Java), it decides to convert something like 0.003897 to 3.897E-3 which is hard to read when going through my temporary-testing-debug-log-thing.

is there any way to keep it as 0.003897?

Heat Death
  • 105
  • 8

1 Answers1

1

Use DecimalFormat like: #.#######

Usage:

DecimalFormat df = new DecimalFormat("#.00"); 

Either use:

System.out.println( String.format( "%.6f", 123.456789d )
roeygol
  • 4,562
  • 7
  • 46
  • 82