Guys and gals,

I am trying to do a simple LITTLE DIVIDE problem using jQuery its getting the values, but when its returning the results, it as if they are being divided by 10000, but I know its not...

E.G. 50506/1000 = 50.506

in my jquery problem, it is coming up as

E.G. 50506/1000 = 0.050506

Here is my jquery

$(function(){
    $('#copy').click(function(e){

        var calculate = parseFloat($("#totalMiles").val()) / parseFloat($("#totalGallons").val());
        $('#TotalMPG').val(calculate);
        var totalMPG = $('#TotalMPG').val();
        $('.mpg').val(totalMPG);
        sync(); <--this is another function i have above this...disreguard
    });
});

can anyone see what my issue is?

when i populated the number...i had a localization string .toLocaleString() and it was messing up the number. Once i removed the .toLocaleString() it fixed it and its now working beautifully. Sorry to bother ya...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.