-3.5527136788005e-15
3.5527136788005e-15
php Under what circumstances will such scientific notation appear?
Is there a function that can directly approximate 0?
Have you ever encountered this?
仅有的幸福2017-05-24 11:35:46
$num = 3.5527136788005e-15;
var_dump(number_format($num));
One step to get it right:
$num = $num < 1 ? 0 : number_format($num, 2);
var_dump($num);
Reference: number_format
世界只因有你2017-05-24 11:35:46
If the decimal point exceeds a few decimal points, it will appear and can be set. If the data is not required to be accurate, rounding can be done