mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 03:51:25 +01:00
Gestion des la precision decimals sur les prix unitaires des produits.
This commit is contained in:
@@ -1959,7 +1959,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1)
|
||||
\remarks Fonction <20> appeler sur montants saisis avant un insert en base
|
||||
\param amount Montant a formater
|
||||
\param rounding 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
|
||||
'MT'=Round to Max with Tax (MAIN_MAX_DECIMALS_TTC)
|
||||
'MT'=Round to Max with Tax (MAIN_MAX_DECIMALS_TOT)
|
||||
'MS'=Round to Max Shown (MAIN_MAX_DECIMALS_SHOWN)
|
||||
''=No rounding
|
||||
\return string Montant au format num<75>rique PHP et SQL (Exemple: '99.99999')
|
||||
@@ -1976,7 +1976,7 @@ function price2num($amount,$rounding='')
|
||||
if ($rounding)
|
||||
{
|
||||
if ($rounding == 'MU') $amount = round($amount,$conf->global->MAIN_MAX_DECIMALS_UNIT);
|
||||
elseif ($rounding == 'MT') $amount = round($amount,$conf->global->MAIN_MAX_DECIMALS_TTC);
|
||||
elseif ($rounding == 'MT') $amount = round($amount,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
elseif ($rounding == 'MS') $amount = round($amount,$conf->global->MAIN_MAX_DECIMALS_SHOWN);
|
||||
else $amount='ErrorBadParameterProvidedToFunction';
|
||||
$amount=ereg_replace(',','.',$amount);
|
||||
|
||||
Reference in New Issue
Block a user