How to convert String to Number - VBscript

Results 1 to 6 of 6

Thread: How to convert String to Number - VBscript

  1. #1
    Join Date
    Dec 1969
    Posts
    778

    Default How to convert String to Number - VBscript

    How to convert a Form Field Value (of input type="text" in ASP)to a whole number in VBscript?

  2. #2
    Dope Guest

    Default RTFM

    .

  3. #3
    Join Date
    Dec 1969
    Posts
    202

    Default Simple...

    CDbl(txtNum)

  4. #4
    Join Date
    Dec 1969
    Posts
    1,432

    Default RE: How to convert String to Number - VBscript

    CInt() will convert to integer but you may want to use Int()<BR><BR><BR>Ex ...<BR>newvar = CInt(Request.Form("textfield"))<BR>or<BR>newvar = Int(Request.Form("textfield"))<BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    202

    Default Duh...

    Whole number. Yep, use Int not Dbl

  6. #6
    Join Date
    Dec 1969
    Posts
    1,432

    Default happens to the best of of <eop>

    ...

Posting Permissions

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