A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Converting a string to a number?

  1. #1
    between 92762 and 92764...
    Join Date
    Jun 2001
    Location
    > 92762 && < 92764
    Posts
    98
    I need to turn a string into a number that you can do math with!

    My example:

    thestring = "h5";
    splicedsuit = thestring.charAt(0);
    splicednumber = thestring.charAt(1);

    (splicedsuit = "h"; splicednumber = "8")<not displayed

    Then I need to do Math like

    whatIneed = 9274 + splicednumber


    If I check the variables durning the movie it says

    whatIneed = 92748

    but I need it to say 9282 and acually add them together not combine them.

    Thanks In Advance!
    Chris

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    1,017
    u shuld use parsint or parsefloat method for changing string to int or float

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center