<?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);
You have javascript disabled. You will not be able to edit any code.