[-] BO : #PSTEST-8 : Javascript - Rounded prices (2 digits only)

This commit is contained in:
François Gaillard
2011-12-19 14:42:23 +00:00
parent acdb26f94e
commit 0bcbe9832b
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ virtual_product_nb_days, is_shareable)
getE('attribute_upc').value = upc;
getE('submitProductAttribute').value = modifyattributegroup;
getE('attribute_wholesale_price').value = Math.abs(wholesale_price);
getE('attribute_price').value = Math.abs(price_impact);
getE('attribute_price').value = Math.round(Math.abs(price_impact)*100)/100;
getE('attribute_weight').value = Math.abs(weight_impact);
getE('attribute_unity').value = Math.abs(unit_impact);
if ($('#attribute_ecotax').length != 0)
+2 -2
View File
@@ -83,8 +83,8 @@ function calcImpactPriceTI()
{
var tax = getTax();
var priceTE = parseFloat(document.getElementById('attribute_price').value.replace(/,/g, '.'));
var newPrice = priceTE * ((tax / 100) + 1);
$('#attribute_priceTI').val((isNaN(newPrice) == true || newPrice < 0) ? '' :ps_round(newPrice.toFixed(6), 6));
var newPrice = Math.round(priceTE * ((tax / 100) + 1)*100)/100;
$('#attribute_priceTI').val((isNaN(newPrice) == true || newPrice < 0) ? '' : ps_round(newPrice.toFixed(6), 6));
var total = ps_round((parseFloat($('#attribute_priceTI').val())*parseInt($('#attribute_price_impact').val())+parseFloat($('#finalPrice').html())), 2);
if (isNaN(total) || total < 0)
$('#attribute_new_total_price').html('0.00');