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.
我有这个代码
echo money_format('£%i', $PL);
但对于负输出,显示为
£-1.00
我想
- 1.00 英镑
如何在井号之前获得 - 号?
谢谢。
setlocale(LC_MONETARY, 'en_GB'); echo money_format('%+n', -123.45); // -£123.45
如果您无法正确看到符号,请尝试使用:
setlocale(LC_MONETARY, 'en_GB.UTF-8'); echo money_format('%+n', -123.45);
http://php.net/manual/en/function.money-format.php