Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting to numeric

Status
Not open for further replies.

mdr227

Programmer
Nov 17, 2000
114
US
I have a form with a few fields where people enter in a gift amount for different programs (of which there can be more than one). Then there is a field where they enter the total amount of the gift they are giving. On my ASP confirmation page I am attempting to verify that the individual gift amounts equal to over gift total they have entered by assigning each form field to a variable (varamt1, varamt2, varamt3 and vartotal) then using the statement &quot;if vartotal <> varamt1 + varamt2 + varamt3 then&quot;. I am using checks to make sure the values entered are numeric and if there is no value entered then the variable is assigned a value of 0. However, the statement is not working because I am getting something like 150 = 1002525 if the giftotal they enter is 150 and the breakdowns are 100, 25 and 25 for the gift categories. My question is what do I need to do to convert the variables to numeric somehow so they can be added together properly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top