Rick Deckard Posted June 2, 2008 Share Posted June 2, 2008 I'm currently studying for the PHP certification and while working through study guide I noticed that the money_format() function appears to work in an inconsistent manner on my linux box. I want to report a bug but I'm not sure if this a problem with my installation or PHP. I've searched the official bug list for reports related to the function - there are 10 listed, but none related to this problem. O/S - Linux (Ubuntu 8.04) PHP Version - 5.4.2-2ubuntu5.1 I created this code to demonstrate the problem (hopefully): $number = 100000.698 ; $arrCountry = array ('GB', 'US', 'CA', 'AU') ; foreach ($arrCountry as $currCountry) { $locale = 'en_' . $currCountry . '.UTF-8'; setlocale (LC_MONETARY, $locale); $locale_info = localeconv(); $currency = $locale_info['int_curr_symbol']; $amount = money_format('%i', $number); printf ("%s [%s] %s \n",$locale, $currency, $amount); } This is the output: en_GB.UTF-8 [GBP ] GBP100,000.70 en_US.UTF-8 [uSD ] USD 100,000.70 en_CA.UTF-8 [CAD ] CAD100,000.70 en_AU.UTF-8 [AUD ] AUD100,000.70 I would expect GBP, CAD and AUD to be formatted the same as USD - i.e. a space between the currency symbol and the numeric. I was wondering if anyone had 5 minutes just to see if they get the same results on a different o/s and/or php version? It's easy to work round but I just wanted to "do the right thing" and report it as a bug if necessary - whether it be with Ubuntu or PHP. Thanks. Link to comment https://forums.phpfreaks.com/topic/108437-function-money_format-space-missing-from-currency-symbols/ Share on other sites More sharing options...
DarkWater Posted June 2, 2008 Share Posted June 2, 2008 PHP 5.2.4-2ubuntu5.1 with Suhosin-Patch 0.9.6.2 (cli) (built: May 9 2008 16:34:16) Same problem. Link to comment https://forums.phpfreaks.com/topic/108437-function-money_format-space-missing-from-currency-symbols/#findComment-555920 Share on other sites More sharing options...
discomatt Posted June 2, 2008 Share Posted June 2, 2008 Same issue. 5.2.0 as well as 5.2.5 on debian 3.1r4 Link to comment https://forums.phpfreaks.com/topic/108437-function-money_format-space-missing-from-currency-symbols/#findComment-555924 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.