-2

I want to format a decimal value in a form that's something like 1.123e-4 while the actual value is 0.0001123

Sourabh
  • 79
  • 8

1 Answers1

-1

Probably this what you are looking at to display decimal values in Exponential form.

public static void main(String[] args) {
        Double a = 0.0001123;
        String value = String.valueOf(a.doubleValue());
        System.out.println(value);
    }

output

1.123E-4
Ankur Singhal
  • 26,012
  • 16
  • 82
  • 116