Converting string to numbers??

Results 1 to 2 of 2

Thread: Converting string to numbers??

  1. #1
    Join Date
    Dec 1969

    Default Converting string to numbers??

    This is propably a very easy answer but I can&#039t seem to find a solution...<BR><BR>I have a form where I want the visitor to enter a price. This field will get saved in my database as an INT-Type. But when someone enters for example: "1500 or less" it obiously gives me an error saying "type mismatch".<BR><BR>How can I take the "1500 or less" statement (or any other statement for that matter...) from the user and format it so that it will only look for the numbers in the string e.g. (1500) instead of (1500 or less).<BR><BR>In javascript I think there is ParseInt or ParseFloat or something like that... but I am using VBScript<BR><BR>Any help would greatly be appreciated.<BR>Andre

  2. #2
    sreeni Guest

    Default RE: Converting string to numbers??

    hi andri,<BR><BR>all you need to do is use the functions instring() and substring(), and get the integer part out of the entire string.i think that&#039s going to solve your problem.<BR><BR>bye<BR><BR>sreeni<BR>sreenyvas@hot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts