3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 0.000000000014; $end = str_replace(".", "", explode("E-", $value)[0]); Preg_match("/\.\d+" . $end ."/", number_format($value, 100), $match); $decimal = strlen($match[0])-1; Echo "fixed 50 decimals\t" .number_format($value, 50) . "\n"; Echo "calculated decimals\t" .number_format($value, $decimal);

preferences:
159.86 ms | 407 KiB | 5 Q