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
  •  


More ASP Resources

Resources:
-- ASP Articles
-- ASP.NET Information
-- 4Guys ASP F.A.Q.
-- ASPFAQs.com
-- ASP Coding Tips
-- Related Web Technologies
-- User Tips!!
-- JavaScripts


Development Centers
-- HTML5 Development Center
-- Windows Mobile Development Center
-- Android Development Center
-- Cloud Development Project Center


Development Technology
Check out these sites for more articles, tutorials, FAQs, discussions, and code!
-- CodeGuru.com
-- VBForums.com
-- DevX.com
-- Developer.com
-- HTMLGoodies