I have this event that when I input qty and price, the amount will be computed and shown automatically. The value for my Qty is '23635' and my price is '.105'. I am expecting an output of 2481.675 but what I am getting is 2481.6749999999997
Here is my code:
$(".forAmount").blur(function () {
var Qty = $("#Qty2").val();
var UnitPrice = $("#UnitPrice2").val();
var currency = $("#Currency").val();
var total = parseFloat(($("#Qty").val().toString().replace(/,/g, '') * $("#UnitPrice").val().toString().replace(/,/g, '')));
}
});
Any idea why I am getting wrong value? Thanks.