| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Useful Functions/Scripts
Hey fellow contributors! well, i was thinking of perhaps starting a "Useful Functions/Scripts page" to eventually add to main asp forum. the idea is to provide OPEN SOURCE code that follows asp/html specs, etc. It would be awesome to have everyone's input on what would make the code better...vote on it...when we think it's completed have a moderator review and if deemed fit for posting then do so. i believe this will potentially bring in more newbies into the forum to help out. besides that i am way curious into how the basic code transforms over the interim into a true slick lil piece of code. i'd like to do ONE at a time of course and suggestions are welcome and vote on priority...ahem after my first entry of course. Remember....try npot to overlook anything ....for example...iin the piece am contributing has no comments as of now but will eventually...so if you build on mine like turning it into a more efficient function for example please include comments. Once completed and blessed by a moderator and g2g for posting then that entry gets 2 rep points when completed because of the idea and starting of the code....recoginition for others should be commented in open source code...if it's 100 it's 100....bottomline is..if we use a suggestion or code...your name is added to list. obviously we can't give out rep points out like candy so only the original poster gets the points...and perhaps will intrigue others to "show-off" their talents and submit soon afyerwards! (Hoping!!) anyways...first thing is first...iif you like this idea than let's vote on it..ahem...shadow? may need your help on this...if you can add a poll then please do...i have no freaking clue how..lol...otherwise we vost comments here...anyways here goes nothin.....
bslintx any moderator voliunteers for this?
__________________
Please give respect to those that helped solve an issue by clicking on the icon
Last edited by bslintx : May 23rd, 2005 at 06:11 PM. |
|
#2
|
||||
|
||||
|
First Submission...car loan calculator
http://k.domaindlx.com/bslintx/car_calc.asp
Code:
<html>
<head>
</head>
<body>
<h3>Car Loan Calculation Demo</h3>
<hr>
<%
retail_price = Request.Form("retail_price")
%>
<form action="car_calc.asp" method="post">
Retail Price: $ <input name="retail_price" size="9" maxlength="9"><br>
Down Payment: $ <input name="down_payment" size="9" maxlength="9"><br>
Sales Tax: <input name="sales_tax" size="4" maxlength="4"> %<br>
Annual Interest Rate: <input name="annual_interest_rate" size="4" maxlength="4"> %<br>
Term of Loan: <select name="term_months">
<option value="">-------Select-------</option>
<option value="12">12 months</option>
<option value="24">24 months</option>
<option value="36">36 months</option>
<option value="48">48 months</option>
<option value="60">60 months</option>
<option value="72">72 months</option>
<option value="84">84 months</option>
</select><br>
<input type="submit" name="submit" value="Calculate">
<input type="reset" name="reset" value="Reset">
</form>
<hr>
<%
If Request.Form("submit") <> "" _
AND Trim(Request.Form("retail_price")) <> "" AND isNumeric(Trim(Request.Form("retail_price"))) _
AND Trim(Request.Form("down_payment")) <> "" AND isNumeric(Trim(Request.Form("down_payment"))) _
AND Trim(Request.Form("sales_tax")) <> "" AND isNumeric(Trim(Request.Form("sales_tax"))) _
AND Trim(Request.Form("annual_interest_rate")) <> "" AND isNumeric(Trim(Request.Form("annual_interest_rate"))) _
AND Trim(Request.Form("term_months")) <> "" AND isNumeric(Trim(Request.Form("term_months"))) Then
%>
<h3>Results: </h3>
<%
retail_price = FormatCurrency(Request.Form("retail_price"),2)
down_payment = FormatCurrency(Request.Form("down_payment"),2)
sales_tax = Request.Form("sales_tax")
If sales_tax > 0 Then
sales_tax = sales_tax/100
ElseIf sales_tax < 0 Then
sales_tax = sales_tax
End If
annual_interest_rate = Request.Form("annual_interest_rate")
If annual_interest_rate > 0 Then
annual_interest_rate = annual_interest_rate/100
ElseIf annual_interest_rate < 0 Then
annual_interest_rate = annual_interest_rate
End If
term_months = Request.Form("term_months")
Const annual = 12
response.Write "Retail Price: " & retail_price & "<br>"
response.write "Sales Tax Amount: " & formatCurrency(retail_price * sales_tax,2) & " (" & sales_tax & "%)<br>"
total_retail_price = formatCurrency((retail_price * sales_tax + retail_price),2)
response.write "Total Retail Price: " & total_retail_price & "<br>"
response.write "Down Payment: " & (down_payment) & "<br>"
ammount_financed = formatCurrency(total_retail_price - down_payment,2)
response.write "Amount Financed: " & ammount_financed & "<br>"
monthly_payment = (ammount_financed * annual_interest_rate/annual) / (1 - (1 + annual_interest_rate/annual)^-term_months)
response.write "Monthly Payment: " & formatCurrency(monthly_payment,2) & "<br>"
total_amount_owed = "Total Amount Owed: " & formatCurrency(monthly_payment * term_months,2)
response.write total_amount_owed
Else
End If
%>
|
|
#3
|
||||
|
||||
|
nice thread, I'll add some nice gadgets I have soon.
![]() as for poll, no need - comments and replies would be good enough... ![]() |
|
#4
|
||||
|
||||
|
Quote:
thanks for moving shadow...appreciated!....4got about the code help ![]() |
|
#5
|
||||
|
||||
|
sure, no problem... so what do you prefer? pythagorean triples, converting to hex or draw board? actually, I've already posted the draw board:
http://forums.aspfree.com/t61326/s.html ![]() |
|
#6
|
||||
|
||||
|
Quote:
in your opinon....not getting much of a response here...thought for sure would...it involves anyone and many can learn through others talents from the original code to final stage.....any suggestions to bring 'em in?...thanks |
|
#7
|
||||
|
||||
|
I'll think of something... but we can't promise reputation points for each code posted, it would make the whole thing look too... artificial. people should share their code willingly out of desire to help, not get points.
![]() |
|
#8
|
||||
|
||||
|
Quote:
fair enough...thought of an incentive...but i guess it comes down to the true reward is working w/ ea other and comng up w/ nice scripts; therefore, no worries on rep points....thanks for looking into it |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Useful Functions/Scripts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|