--- dolibarr-cvs/htdocs/lib/functions.inc.php 2006-08-27 14:33:01.000000000 +0100 +++ dolibarr/htdocs/lib/functions.inc.php 2006-08-27 14:31:41.000000000 +0100 @@ -1712,18 +1712,31 @@ \param html Formatage html ou pas (0 par defaut) \seealso price2num Fonction inverse de price */ -function price($amount, $html=0) +function price($amount, $html=0, $l10n=null) { - if ($html) - { - - $dec='.'; $thousand=' '; - return ereg_replace(' ',' ',number_format($amount, 2, $dec, $thousand)); - - } - else - { - return number_format($amount, 2, '.', ' '); + $dec='.'; $thousand=' '; + if(!empty($l10n)){ + switch($l10n){ + case 'fr_FR': + case 'fr_BE': + case 'nl_BE': + $dec = ','; + $thousand = ' '; + break; + case 'en_US': + $dec = '.'; + $thousand = ','; + } + if ($html) + { + return ereg_replace(' ',' ',number_format($amount, 2, $dec, $thousand)); + } + else + { + return number_format($amount, 2, $dec, $thousand); + } + }else{ + return number_format($amount, 2, '.', ' '); } }