Home > Backend Development > PHP Tutorial > 保留价格.00

保留价格.00

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:56:56
Original
1187 people have browsed it

 $price = "98.00";$num   = 2;$total = $price * $num;
Copy after login

如何$total保留.00?


回复讨论(解决方案)

number_format 这个函数可以实现

echo sprintf("%.2f",98);

Related labels:
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template