2
0
forked from Wavyzz/dolibarr

Fix: debut de correction sur pb arrondis

This commit is contained in:
Laurent Destailleur
2007-03-29 23:34:09 +00:00
parent 9212437d9b
commit 85da803077
2 changed files with 58 additions and 60 deletions

View File

@@ -1842,15 +1842,12 @@ function price($amount, $html=0, $outlangs='')
// On pose par defaut 2 decimales
$decimal = 2;
$amount = ereg_replace(',','.',$amount);
$datas = explode('.',$amount);
$cents = $datas[1];
// On augmente au besoin
if ($cents > 99 )
$decimal = 3;
$amount = ereg_replace(',','\.',$amount);
$datas = split('\.',$amount);
$decpart = $datas[1];
if ($cents > 999 )
$decimal = 4;
// On augmente au besoin si il y a plus de 2 d<>cimales
if (strlen($decpart) > 2) $decimal=strlen($decpart);
// Formate nombre
if ($html)