php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28746 money_format broke in php 4.3.6
Submitted: 2004-06-11 21:48 UTC Modified: 2004-06-21 01:00 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: isp at derdev dot com Assigned:
Status: No Feedback Package: Output Control
PHP Version: 4.3.6 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: isp at derdev dot com
New email:
PHP Version: OS:

 

 [2004-06-11 21:48 UTC] isp at derdev dot com
Description:
------------
The combination of setlocale and money_format worked for me in php 4.3.4.  Upgrading to php 4.3.6 and changing servers seems to have broken setlocale and/or money_format.

Reproduce code:
---------------
<?php
$item="987654.321";
setlocale(LC_MONETARY, 'en_US');
print money_format('%.2n',$item);
# prints 987654.321

?>

Expected result:
----------------
$987,654.32

Actual result:
--------------
987654.32

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-13 19:01 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Works fine here, keep in mind that PHP's money_format() 
function is a direct wrapper around the libc C equivalent. 
If it does not work this has likely to do with your libc 
then PHP. 
 [2004-06-21 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".
 [2005-06-13 22:53 UTC] steve at jigstop dot com
I have this same issue on PHP 4.3.10 on IIS 5.0

Documentation stats this works on all PHP > 4.3.0 yet it apparently does not.

It looks like this funtion may require other software installed on the server besides PHP. Why can't this just be included in PHP like ever other PHP function I have used?
 [2005-07-13 21:10 UTC] brandon at axonmedia dot ca
I too have the same problem with money_format() with PHP 4.3.10

It only formats the input string half of the time for me though.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 04:01:31 2024 UTC