Fix number to string

This commit is contained in:
Laurent Destailleur 2020-08-06 02:58:07 +02:00
parent 0b7aec1fa0
commit 641d9a6565

View File

@ -163,10 +163,11 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
*/ */
function dolNumberToWord($numero, $langs, $numorcurrency = 'number') function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
{ {
// If the number is negative convert to positive and return -1 if is too long // If the number is negative convert to positive and return -1 if it is too long
if ($numero < 0) $numero *= -1; if ($numero < 0) $numero *= -1;
if ($numero >= 1000000000001) if ($numero >= 1000000000001) {
return -1; return -1;
}
// Get 2 decimals to cents, another functions round or truncate // Get 2 decimals to cents, another functions round or truncate
$strnumber = number_format($numero, 10); $strnumber = number_format($numero, 10);