Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 php 输出 14.85,我想为 14.50 和 14.47 设置为 14.90。我正在尝试使用圆形功能,但我没有得到正确的数字格式,这可能吗?
谢谢
number_format(round($var, 1), 2)应该做的伎俩。
number_format(round($var, 1), 2)
与您可以使用的大多数编程语言一样ceil(),floor()或者round()
ceil()
floor()
round()