我的指数非常小,显示如下:
5.2255534523412e-7
我可以将其显示为:
5.22e-7
答案 0 :(得分:1)
使用sprintf()格式化输出
https://framework7.io/docs/tabs.html
$a = 5.2255534523412e-7;
// change 2 to be how many decimal places you want. The e treats it as scientific notation.
echo sprintf('%.2e', $a);