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.
我需要为数千个地方添加逗号,而无需将函数添加 .00 结束。就像这样 10,000.00 我想要 10,000
采用number_format()
number_format()
$number = 1234.56; echo number_format($number); // 1,235
尝试number_format:
number_format
$num = 10000; $formatted = number_format($num); // '10,000'
这是一个演示。