我需要建立一个贷款计算器。我有两个滑块,用户选择他们的贷款金额和贷款期限,然后它应输出他们的每月付款。如何显示没有小数的每月还款?
请参阅下面的代码:
<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>