开发者

.toFixed(2) not working?

开发者 https://www.devze.com 2023-01-29 05:27 出处:网络
Can someone please please enlighten me to as why my toFixed() isn\'t working? $(\"#amount\").blur(function() {

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

0

精彩评论

暂无评论...
验证码 换一张
取 消