Re: Re: [PHP] Round with money_format

2011-09-17 Thread Bill Guion
On Sep 17, 2011, at 3:46 AM, Cyril Lopez wrote: From: Cyril Lopez cy...@nethik.fr Date: September 16, 2011 10:58:28 AM EDT To: php-general@lists.php.net Subject: Round with money_format Hi, Can someone help me understand how money_format() rounds numbers ? ?php setlocale(LC_ALL,

Re: [PHP] Round with money_format

2011-09-17 Thread Tedd Sperling
On Sep 17, 2011, at 10:56 AM, Bill Guion wrote: On Sep 17, 2011, at 3:46 AM, Cyril Lopez wrote: Can someone help me understand how money_format() rounds numbers ? As someone else pointed out, rounding rules vary by locale, but I was taught 40+ years ago in graduate school programming

Re: Re: [PHP] Round with money_format

2011-09-17 Thread Richard Quadling
On 17 September 2011 15:56, Bill Guion bgu...@comcast.net wrote: On Sep 17, 2011, at 3:46 AM, Cyril Lopez wrote: From: Cyril Lopez cy...@nethik.fr Date: September 16, 2011 10:58:28 AM EDT To: php-general@lists.php.net Subject: Round with money_format Hi, Can someone help me understand

Re: [PHP] Round with money_format

2011-09-16 Thread Richard Quadling
On 16 September 2011 15:58, Cyril Lopez cy...@nethik.fr wrote: Hi, Can someone help me understand how money_format() rounds numbers ? ?php  setlocale(LC_ALL, 'fr_FR.UTF-8');  $price = 12.665;  echo money_format('%i',$price);  // 12.66 EUR, 12.67 EUR expected  $price2 = 12.666;  echo

Re: [PHP] Round with money_format

2011-09-16 Thread Stuart Dallas
On 16 Sep 2011, at 15:58, Cyril Lopez wrote: Can someone help me understand how money_format() rounds numbers ? ?php setlocale(LC_ALL, 'fr_FR.UTF-8'); $price = 12.665; echo money_format('%i',$price); // 12.66 EUR, 12.67 EUR expected $price2 = 12.666; echo

Re: [PHP] Round with money_format

2011-09-16 Thread Stuart Dallas
Oops... On 16 Sep 2011, at 16:36, Stuart Dallas wrote: On 16 Sep 2011, at 15:58, Cyril Lopez wrote: Can someone help me understand how money_format() rounds numbers ? ?php setlocale(LC_ALL, 'fr_FR.UTF-8'); $price = 12.665; echo money_format('%i',$price); // 12.66 EUR, 12.67 EUR