mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-04 15:13:40 -04:00
Corrected Function call
- setAttribute() expects the second parameter to be an int or float. setTextAttribute() resolves this. - Added TODO
This commit is contained in:
@@ -467,7 +467,7 @@ class Config extends Secure_Controller
|
||||
|
||||
if($this->request->getPost('thousands_separator') == 'false')
|
||||
{
|
||||
$fmt->setAttribute(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, '');
|
||||
$fmt->setTextAttribute(NumberFormatter::GROUPING_SEPARATOR_SYMBOL, '');
|
||||
}
|
||||
|
||||
$fmt->setSymbol(NumberFormatter::CURRENCY_SYMBOL, $currency_symbol);
|
||||
|
||||
@@ -424,7 +424,7 @@ function parse_decimals(string $number, int $decimals = null): mixed
|
||||
return $number;
|
||||
}
|
||||
|
||||
if ($number > MAX_PRECISION)
|
||||
if ($number > MAX_PRECISION) //TODO: This breaks when the string passed does not use . as the decimal separator.
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -443,7 +443,7 @@ function parse_decimals(string $number, int $decimals = null): mixed
|
||||
$decimals = $config['currency_decimals'];
|
||||
}
|
||||
|
||||
$fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
|
||||
$fmt->setAttribute(NumberFormatter::FRACTION_DIGITS, $decimals);
|
||||
|
||||
if(empty($config['thousands_separator']))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user