遇見科學記數法的時候
解決方法就是
使用php格式化數字函數:number_format()
使用方法如下:
echo number_format("5000000")."<br>";
//5,000,000
echo number_format("5000000",2)."<br>";
//5,000,000.00
echo number_format("5000000",2,",",".");
//5.000.000,00
還有個網上的栗子:
//舉個例子
echo '1869879738796128';
//默認結果爲:1.8698797387961E+15
//解決辦法
echo number_format(‘1869879738796128’, 0, '', '');
//輸出結果爲:1869879738796128