5

I've a float data in my code, i need to get the string out of it . the problem is , when I have big number like 10000000 ,It converts the number to something like this : 1.0E7

How can I convert it to the actual number ?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Navid Abutorab
  • 1,667
  • 7
  • 31
  • 58

1 Answers1

5

follow this way to get the actual number

   float firstNumber = (float) 1.0E7;
    String firstNumberAsString = String.format("%.0f", firstNumber);
    Log.v(" OUt-Put", firstNumberAsString);

It will Give you:

android V/  OUt-Put: 10000000
Milan Pansuriya
  • 2,521
  • 1
  • 19
  • 33