-1

enter image description here

I need help converting a string that contains a number in scientific notation to a normal string. Example strings: "9.1892E+11" to "918919850755"

Mohit Tiwari
  • 165
  • 2
  • 6

1 Answers1

1

PHP should understand the scientific notation. By substracting or adding 0 or something, it will change to a normal notation.

By doing this you might lose precision. You can cast the string to a float to prevent this.

$number = (float)$number;
DigiLive
  • 1,093
  • 1
  • 11
  • 28