Code comment
This commit is contained in:
parent
7eb3e324c7
commit
093eab188e
@ -4866,7 +4866,7 @@ function price2num($amount, $rounding = '', $option = 0)
|
|||||||
|
|
||||||
// Convert value to universal number format (no thousand separator, '.' as decimal separator)
|
// Convert value to universal number format (no thousand separator, '.' as decimal separator)
|
||||||
if ($option != 1) { // If not a PHP number or unknown, we change or clean format
|
if ($option != 1) { // If not a PHP number or unknown, we change or clean format
|
||||||
//print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'<br>';
|
//print "\n".'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'<br>';
|
||||||
if (!is_numeric($amount)) {
|
if (!is_numeric($amount)) {
|
||||||
$amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\_]/', '', $amount);
|
$amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\_]/', '', $amount);
|
||||||
}
|
}
|
||||||
@ -4896,6 +4896,7 @@ function price2num($amount, $rounding = '', $option = 0)
|
|||||||
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||||
$amount = str_replace($dec, '.', $amount);
|
$amount = str_replace($dec, '.', $amount);
|
||||||
}
|
}
|
||||||
|
//print ' XX'.$amount.' '.$rounding;
|
||||||
|
|
||||||
// Now, make a rounding if required
|
// Now, make a rounding if required
|
||||||
if ($rounding)
|
if ($rounding)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user