Round with money_format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 money_format('%i',$price2);
  // 12.67 EUR, ok

  echo round($price,2);
  // 12.67, ok
  echo round($price2,2);
  // 12.67, ok
?>

Misconfiguration ? Bug ?
Thanks !

Cyril

Config :
Debian Lenny, PHP 5.3.8

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux