php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44183 money_format: "!" modifier trims negative symbol for certain locales
Submitted: 2008-02-20 10:31 UTC Modified: 2008-06-23 01:00 UTC
From: mail at tomsommer dot dk Assigned: hholzgra (profile)
Status: No Feedback Package: Math related
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
34 + 1 = ?
Subscribe to this entry?

 
 [2008-02-20 10:31 UTC] mail at tomsommer dot dk
Description:
------------
money_format trims the negative symbol for certain locales.

For danish, this means that the string "kr -1,00" is trimmed to "1,00" if the "!" modifier is given, trimming more than just the currency symbol.

Reproduce code:
---------------
setlocale(LC_ALL, 'da_DK', 'danish');
echo money_format('%!n', -1);

Expected result:
----------------
-1,00

Actual result:
--------------
1,00

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-15 21:16 UTC] hholzgra@php.net
What is the exact linux distribution version you are using?

I just tested this with Ubuntu 8.04 and the bundled PHP 5.2.4 
version and got a "-1.00" result just fine with da_DA.UTF-8 ...
 [2008-06-23 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC