2
0
forked from Wavyzz/dolibarr

Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0

This commit is contained in:
Laurent Destailleur
2024-08-27 04:46:30 +02:00
4 changed files with 19 additions and 8 deletions

View File

@@ -6602,11 +6602,11 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
$nbdecimal = dol_strlen($decpart);
}
// Si on depasse max
$max_nbdecimal = getDolGlobalString('MAIN_MAX_DECIMALS_SHOWN');
if ($trunc && $nbdecimal > (int) $max_nbdecimal) {
$max_nbdecimal = (int) str_replace('...', '', getDolGlobalString('MAIN_MAX_DECIMALS_SHOWN'));
if ($trunc && $nbdecimal > $max_nbdecimal) {
$nbdecimal = $max_nbdecimal;
if (preg_match('/\.\.\./i', $nbdecimal)) {
// Si un affichage est tronque, on montre des ...
if (preg_match('/\.\.\./i', getDolGlobalString('MAIN_MAX_DECIMALS_SHOWN'))) {
// If output is truncated, we show ...
$end = '...';
}
}
@@ -6614,9 +6614,9 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
// If force rounding
if ((string) $forcerounding != '-1') {
if ($forcerounding === 'MU') {
$nbdecimal = getDolGlobalString('MAIN_MAX_DECIMALS_UNIT');
$nbdecimal = getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT');
} elseif ($forcerounding === 'MT') {
$nbdecimal = getDolGlobalString('MAIN_MAX_DECIMALS_TOT');
$nbdecimal = getDolGlobalInt('MAIN_MAX_DECIMALS_TOT');
} elseif ($forcerounding >= 0) {
$nbdecimal = $forcerounding;
}