#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Posts
    26
    Rep Power
    0

    How to convert int to string


    Is there a method to convert an int to a string ?

    Thanks,
    robert
  2. #2
  3. ordinated
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    Madrid, Spain
    Posts
    457
    Rep Power
    28
    the conversion comes from context...ie
    v = 3; //v is an interger
    v= v + ""; //v is now a string
    v= v + 4; //v is still a string

    alert(v) returns "34" not 7
    John Resig for president. jQuery 1.3 floats my boat
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Posts
    26
    Rep Power
    0

    re:


    Thank you, I couldn't find anything about this on google. I thought parseString or something would exist. But this works good.

    robert
  6. #4
  7. Cunning Linguist
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    Location
    I used to live at home, now I stay at the house
    Posts
    10,180
    Rep Power
    2039
    You can also use the toString() method to cast things to strings.

IMN logo majestic logo threadwatch logo seochat tools logo