Bug #78562 [Opn->Fbk]: money_format() returns string with incorrect number

From: Date: Wed, 18 Sep 2019 20:56:37 +0000
Subject: Bug #78562 [Opn->Fbk]: money_format() returns string with incorrect number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222811@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78562&edit=1

 ID:                 78562
 Updated by:         requinix@php.net
 Reported by:        candace dot camarillo at vacasa dot com
 Summary:            money_format() returns string with incorrect number
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            *Math Functions
 Operating System:   Apline Linux 3.8
 PHP Version:        7.2.22
 Block user comment: N
 Private report:     N

 New Comment:

Are you hardcoding 2040.33 into your script? Or did you do some math to get that number?


Previous Comments:
------------------------------------------------------------------------
[2019-09-18 19:42:09] candace dot camarillo at vacasa dot com

Description:
------------
---
From manual page: https://php.net/function.money-format
---
Running money_format() with the number 2040.33 returns a string with 2040.32.  Other numbers seem to
work.  I have not iterated through others to determine which cause the problem.  Playing with locale
and other flags makes no impact on the problem.

Test script:
---------------
echo money_format('%i', 2040.33); // returns '2040.32'

Expected result:
----------------
'2040.33'

Actual result:
--------------
'2040.32'


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78562&edit=1


Thread (10 messages)

« previous php.bugs (#222811) next »