Can you convert a string to a number?

Is there a way to convert a string to a number? Specifically an Integer?

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881

    If you are talking about changing a string of numerical characters (such as "125"), into an integer, the answer is yes.

    Just use a change attribute behavior:
    Change Attribute: self.myInteger To: self.myNumString

  • ookami007ookami007 Member Posts: 581

    Thanks... I guess the variables are like var's in java rather than typed variables in C.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    GameSalad runs on Lua if that's helpful...

  • ArmellineArmelline Member, PRO Posts: 5,421

    Numbers contained in strings can be used as integers. You can perform maths on them etc. Normally there's no reason to specifically convert them.

Sign In or Register to comment.