diff --git a/themes/default-bootstrap/js/tools.js b/themes/default-bootstrap/js/tools.js index ae11f36be..04a7d5ee9 100644 --- a/themes/default-bootstrap/js/tools.js +++ b/themes/default-bootstrap/js/tools.js @@ -30,12 +30,12 @@ function ps_round(value, precision) if (typeof(precision) === 'undefined') precision = 2; - method = roundMode; + var method = roundMode; if (method === 0) return ceilf(value, precision); else if (method === 1) return floorf(value, precision); - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); return Math.round(value * precisionFactor) / precisionFactor; } @@ -43,9 +43,9 @@ function ceilf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.ceil(value * precisionFactor) / precisionFactor; @@ -55,9 +55,9 @@ function floorf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.floor(value * precisionFactor) / precisionFactor; @@ -81,7 +81,7 @@ function formatedNumberToFloat(price, currencyFormat, currencySign) function formatCurrency(price, currencyFormat, currencySign, currencyBlank) { // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) - blank = ''; + var blank = ''; price = parseFloat(price.toFixed(6)); price = ps_round(price, priceDisplayPrecision); if (currencyBlank > 0) @@ -95,7 +95,7 @@ function formatCurrency(price, currencyFormat, currencySign, currencyBlank) if (currencyFormat == 4) return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign); if (currencyFormat == 5) - return (formatNumber(price, priceDisplayPrecision, ' ', '.') + blank + currencySign); + return (currencySign + blank + formatNumber(price, priceDisplayPrecision, '\'', '.')); return price; } diff --git a/themes/default/js/tools.js b/themes/default/js/tools.js index 7b670168c..3399f8a2d 100644 --- a/themes/default/js/tools.js +++ b/themes/default/js/tools.js @@ -30,12 +30,12 @@ function ps_round(value, precision) if (typeof(precision) === 'undefined') precision = 2; - method = roundMode; + var method = roundMode; if (method === 0) return ceilf(value, precision); else if (method === 1) return floorf(value, precision); - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); return Math.round(value * precisionFactor) / precisionFactor; } @@ -43,9 +43,9 @@ function ceilf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.ceil(value * precisionFactor) / precisionFactor; @@ -55,9 +55,9 @@ function floorf(value, precision) { if (typeof(precision) === 'undefined') precision = 0; - precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); - tmp = value * precisionFactor; - tmp2 = tmp.toString(); + var precisionFactor = precision === 0 ? 1 : Math.pow(10, precision); + var tmp = value * precisionFactor; + var tmp2 = tmp.toString(); if (tmp2[tmp2.length - 1] === 0) return value; return Math.floor(value * precisionFactor) / precisionFactor; @@ -81,7 +81,7 @@ function formatedNumberToFloat(price, currencyFormat, currencySign) function formatCurrency(price, currencyFormat, currencySign, currencyBlank) { // if you modified this function, don't forget to modify the PHP function displayPrice (in the Tools.php class) - blank = ''; + var blank = ''; price = parseFloat(price.toFixed(6)); price = ps_round(price, priceDisplayPrecision); if (currencyBlank > 0) @@ -212,7 +212,7 @@ function in_array(value, array) function resizeAddressesBox(nameBox) { - maxHeight = 0; + var maxHeight = 0; if (typeof(nameBox) === 'undefined') nameBox = '.address';