PHP implements the method of converting scientific notation into original number string, counting string
The example in this article describes how PHP implements the conversion of scientific notation into original numeric strings. It is shared with everyone for your reference.
The specific implementation code is as follows:
Copy code The code is as follows:
function NumToStr($num){
If (stripos($num,'e')===false) return $num;
$num = trim(preg_replace('/[='"]/','',$num,1),'"');//Scientific notation appears and is restored to a string
$result = "";
While ($num > 0){
$v = $num - floor($num / 10)*10;
$num = floor($num / 10);
$result = $v . $result;
}
Return $result;
}
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/928223.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/928223.htmlTechArticlePHP implements the method of converting scientific notation into original numeric strings, counting strings. The example of this article tells the PHP implementation Method to convert scientific notation to original number string, share with...