Skip to content

Commit

Permalink
FIX convert amount into text when using numberwords
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 14, 2024
1 parent cd510a4 commit 80ced1c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions htdocs/core/lib/functionsnumtoword.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
*/
function dol_convertToWord($num, $langs, $currency = '', $centimes = false)
{
global $conf;

//$num = str_replace(array(',', ' '), '', trim($num)); This should be useless since $num MUST be a php numeric value
if (!$num) {
return false;
Expand All @@ -48,13 +46,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false)
}

if (isModEnabled('numberwords')) {
if ($currency) {
$type = '1';
} else {
$type = '0';
}

$concatWords = $langs->getLabelFromNumber($num, $type);
$concatWords = $langs->getLabelFromNumber($num, $currency);
return $concatWords;
} else {
$TNum = explode('.', (string) $num);
Expand Down

0 comments on commit 80ced1c

Please sign in to comment.