Charles Web Dev
Charles Web Dev

Reputation: 429

.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 100, please try again")
        } else {
        $('#fee').val(parseFloat($('#amount').val()) * .035).toFixed(2);
        }

        });

Upvotes: 4

Views: 15899

Answers (1)

rahul
rahul

Reputation: 187030

Try

$('#fee').val(parseFloat($('#amount').val() * .035).toFixed(2));

Rearranged the brackets

Upvotes: 8

Related Questions