[-] BO : #PSCFV-3670 : add a new format of currency in JS files

This commit is contained in:
lLefevre
2012-08-29 14:52:47 +00:00
parent d54d31463c
commit ef1f4bde50
3 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -105,7 +105,6 @@ class CurrencyCore extends ObjectModel
// price sign before or after the price number
$this->prefix = $this->format % 2 != 0 ? $this->sign.' ' : '';
$this->suffix = $this->format % 2 == 0 ? ' '.$this->sign : '';
}
/**
* Overriding check if currency with the same iso code already exists.
@@ -181,12 +180,15 @@ class CurrencyCore extends ObjectModel
'left' => $this->sign.' ',
'right' => ' '.$this->sign
);
$formats = array(
1 => array('left' => &$formated_strings['left'], 'right' => ''),
2 => array('left' => '', 'right' => &$formated_strings['right']),
3 => array('left' => &$formated_strings['left'], 'right' => ''),
4 => array('left' => '', 'right' => &$formated_strings['right']),
5 => array('left' => '', 'right' => &$formated_strings['right'])
);
return ($formats[$this->format][$side]);
}
+2
View File
@@ -73,6 +73,8 @@ function formatCurrency(price, currencyFormat, currencySign, currencyBlank)
return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '.', ','));
if (currencyFormat == 4)
return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign);
if (currencyFormat == 5)
return (formatNumber(price, priceDisplayPrecision, ' ', '.') + blank + currencySign);
return price;
}
+2
View File
@@ -95,6 +95,8 @@ function formatCurrency(price, currencyFormat, currencySign, currencyBlank)
return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '.', ','));
if (currencyFormat == 4)
return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign);
if (currencyFormat == 5)
return (formatNumber(price, priceDisplayPrecision, ' ', '.') + blank + currencySign);
return price;
}