H5W3
当前位置:H5W3 > 问答 > 正文

php如何将数字转换成科学计数法?

php如何将0.00001转换成1.00E-05 ?

 

回答:

php 自带函数
参考官方文档 sprintf

e
The argument is treated as scientific notation (e.g. 1.2e+2). The precision specifier stands for the number of digits after the decimal point since PHP 5.2.1. In earlier versions, it was taken as number of significant digits (one less).

E
Like the e specifier but uses uppercase letter (e.g. 1.2E+2).

本文地址:H5W3 » php如何将数字转换成科学计数法?