Fixed wrong calculated price when comma is used instead of dot.

This commit is contained in:
Julien Chanséaume
2014-07-15 16:39:13 +02:00
committed by Julien Chanseaume
parent 0310dce719
commit 12e84afdf8
2 changed files with 13 additions and 1 deletions

View File

@@ -794,10 +794,16 @@
captureLength: 1,
wait : 300,
callback : function () {
var price = $(this).val();
$(this).val(sanitizeFloat(price));
update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price'));
}
});
function sanitizeFloat(numVal) {
return numVal.replace(",", ".");
};
});
</script>
{/block}

View File

@@ -363,10 +363,16 @@ $(function() {
captureLength: 1,
wait : 300,
callback : function () {
update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price'));
var price = $(this).val();
$(this).val(sanitizeFloat(price));
update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price'));
}
});
function sanitizeFloat(numVal) {
return numVal.replace(",", ".");
};
// Count generated combinations in real time
function countGeneratedCombinations() {