I am getting NaN
as result and its beacuse my jquery is multiplying numbers that look like "204,3 * 3"
How can I deal with it?
I cant change the price, so what can I do?
"234 * 2"
works fine as soon as the number have ','
I get NaN
.
<script type="text/javascript">
$('.quantity').keyup(function () {
var parent = $(this).parent(),
price = parent.find('.price').html(),
quantity = parent.find('.quantity').val(),
result = price * quantity;
parent.find('.price2').html(result);
});
</script>
<span class="price">69,9</span>
<input type="text" class="quantity">
<span class="price2">69,9</span>
<span class="total">Total:</span>
<div class="line2"></div>
Check my JSfiddle everything is there
Any kind of help is appreciated