I want to allow the user to enter duration & amount of loan & then display the amount of the monthly & weekly instalements in textboxes. However I am getting an 'Overflow' error.
Code:
<%
dim time, amt, total, int, intTotal, finalTotal, month, monthly, week, weekly
time = Request.Form("txtDuration")
amt = Request.Form("txtAmt")
int = 0.08
if CCur(time) = 1 then
month = 12
week = 52
ElseIf CCur(time) = 2 then
month = 24
week = 104
End If
intTotal = (CCur(amt) * CCur(int))
total = (CCur(intTotal) + CCur(amt))
monthly = (CCur(total) / CCur(month))
weekly = (CCur(total) / CCur(week))
%>
<form action=# method="POST">
<table align=center border=0 width="394" rules="none">
<tr>
<th align=center width="194">Monthly Repayments</th>
<th align=center width="194">Weekly Repayments</th>
</tr>
<tr>
<td align=center width="194"><input type="text" name="txtMonthly"
value="<%Response.Write(monthly)%>"> </td>
<td align=center width="194"><input type="text" name="txtWeekly"
value="<%Response.Write(weekly)%>"> </td>
</tr>
</table>
</form>
Help please......thanks