PHP implements the method of converting scientific notation to the original numeric string, counting the string
The example of this paper introduces the method of translating scientific counting method into original digital string by PHP, and shares it for everyone's reference.
The specific implementation code is as follows:
Copy the Code code as follows: function Numtostr ($num) {
if (Stripos ($num, ' e ') ===false) return $num;
$num = Trim (preg_replace ('/[=\ ' ""]/', "', $num, 1), '" ');//appear scientific counting method, revert to string
$result = "";
while ($num > 0) {
$v = $num-floor ($num/10) *10;
$num = Floor ($num/10);
$result = $v. $result;
}
return $result;
}
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/928223.html www.bkjia.com true http://www.bkjia.com/PHPjc/928223.html techarticle PHP Implementation of the method of converting scientific notation to the original numeric string, count string This article describes the PHP implementation of the scientific notation to the original string of the method of conversion, share to ...