fix price for forms

This commit is contained in:
Frédéric FRANCE
2025-02-26 11:00:00 +01:00
committed by GitHub
parent 05e0462a9a
commit 496c796565

View File

@@ -6956,10 +6956,6 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
// Format number
$output = number_format((float) $amount, $nbdecimal, $dec, $thousand);
if ($form) {
$output = preg_replace('/\s/', ' ', $output);
$output = preg_replace('/\'/', ''', $output);
}
// Add symbol of currency if requested
$cursymbolbefore = $cursymbolafter = '';
if ($currency_code && is_object($outlangs)) {
@@ -6977,6 +6973,10 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
}
}
$output = $cursymbolbefore.$output.$end.($cursymbolafter ? ' ' : '').$cursymbolafter;
if ($form) {
$output = preg_replace('/\s/', ' ', $output);
$output = preg_replace('/\'/', ''', $output);
}
return $output;
}