3v4l.org

run code in 200+ php & hhvm versions
<?php function makeScientificNumber($number){ $power = ($number % 10) - 1; return ($number / pow(10, $power)) . "e" . $power; } function makeNormalNumber($scientific){ return number_format($scientific,0,'.',''); } $number = 4567; $scientific_number = makeScientificNumber($number); echo "Scientific number is = $scientific_number"; echo PHP_EOL; $normal_number = makeNormalNumber($scientific_number); echo "Normal number is $normal_number";
based on i1h1d
Output for 5.6.38 - 7.2.11
Scientific number is = 0.004567e6 Normal number is 4567