Home >Backend Development >PHP Tutorial > 关于PHP的除法解决方案

关于PHP的除法解决方案

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 13:17:041124browse

关于PHP的除法
$abc=285083800;
$truit=10000000;

$abc=$abc/$truit;

得出的值是:28.508379999999998943849277566
而不是:28.5083800

是一个软件的接口PHP,不知道软件经过什么处理弄的值精确到下面这么多位小数点
请问怎么写代码让值为28.5083800


哪为知道的大哥帮帮忙,直接给完整的代码,谢谢了

------解决方案--------------------
$abc=285083800;
$truit=10000000;

$abc=$abc/$truit;


echo number_format($abc,7,'.','');

//28.5083800

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn