I need to build a loan calculator. I have two sliders where the users select their loan amount, and loan period, and then it should output their monthly payment. How do I show the monthly repayment without decimals?
See my code below:
<form oninput="loanval.value=loan.value; periodval.value=period.value; paymentval.value=loan.value / period.value">
<label>Choose Loan Amount</label>
<input type="range" id="loan" name="loan" min="5000" max="400000">
<output name="loanval" for="loan">0</output><br />
<label>Choose Loan Period</label>
<input type="range" id="period" name="period" min="12" max="72">
<output name="periodval" for="period">0</output><br />
<label>Your monthly repayment will be:</label>
<output name="paymentval">0</output>
</form>