Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    string to num and num to string how?

    hi,

    string to num and num to string how?

    thanks.

  • #2
    New Coder
    Join Date
    Apr 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i mean-i have a variable with a string - "50px"

    i mean-i have a variable with a string - "50px" and i want just the 50 in a variable which is no string...

    how?
    thanks..

  • #3
    New Coder
    Join Date
    Apr 2006
    Location
    Joussard, Alberta
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    parseInt(variable) should strip the 50 from the px for you...

    so
    if oldvar='50px'

    var newvar =parseInt(oldvar);

    should work for you.

  • #4
    New Coder
    Join Date
    Apr 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks - where can I learn more on this specific function

    thanks - where can I learn more on this specific function?


  •  

    Posting Permissions

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