.toFixed(2) not working?
Can someone please please enlighten me to as why my toFixed() isn't working?
$("#amount").blur(function() {
if ($('#amount').val() % 100 != 0) {
alert("must be a multiple of 开发者_如何学JAVA100, please try again")
} else {
$('#fee').val(parseFloat($('#amount').val()) * .035).toFixed(2);
}
});
Try
$('#fee').val(parseFloat($('#amount').val() * .035).toFixed(2));
Rearranged the brackets
精彩评论