Fix warning

This commit is contained in:
Laurent Destailleur 2020-12-12 14:11:50 +01:00
parent a3d302d91c
commit 7fdae69546

View File

@ -139,8 +139,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false)
}
// If we need to write cents call again this function for cents
$decimalpart = $TNum[1];
$decimalpart = preg_replace('/0+$/', '', $decimalpart);
$decimalpart = empty($TNum[1]) ? '' : preg_replace('/0+$/', '', $TNum[1]);
if ($decimalpart) {
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');