I'm new to javascript, and really did try to find a solution but I don't know how to apply it to my specific code.
I have two range fields on a form which I want to use as a loan calculator. So, value1 is for the 'loan amount', value2 is for the 'repayment period'. So value1 needs to be divided by value2, and then it needs to output it into an ID called #fullvalue so that I can show the repayment installment value on the form. My code below is working great, however, I can't for the life of me get it right to output the #fullvalue amount to two decimal places. So that it shows like $79.50 instead of something like $75.56789555
$(window).on('load', function() {
$("form :input").change(function() {
var value1 = $('form #value1').val();
var value2 = $('form #value2').val();
var fullvalue = parseInt(value1, 10) / parseInt(value2, 10);
$('form #fullvalue').val(fullvalue);
});
});