Transform a String into an Integer
3 posts • Page 1 of 1
Transform a String into an Integer
Hi!
I'm trying to het the value stored in a Box's text, but I get a string. I need an Integer, so I tried to use some of C++ functions ( atoi() ), but it doesn't seem to work...
How can I do this?
I'm trying to het the value stored in a Box's text, but I get a string. I need an Integer, so I tried to use some of C++ functions ( atoi() ), but it doesn't seem to work...
How can I do this?
-

roobre - Posts: 11
- Joined: Sat Sep 05, 2009 5:14 pm
Re: Transform a String into an Integer
math.toInt("1") returns 1
Btw,
math.toFloat("3.14") returns 3.14
math.toBool("1") returns true
math.toBool("0") returns false
(Note: Currently, all of them are Algodoo only.)
Btw,
math.toFloat("3.14") returns 3.14
math.toBool("1") returns true
math.toBool("0") returns false
(Note: Currently, all of them are Algodoo only.)
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
-

tatt61880 - [Most Helpful Person 2010]
- Posts: 1150
- Joined: Mon Aug 31, 2009 5:45 pm
- Location: Tokyo, Japan
Re: Transform a String into an Integer
Thanks! it works!

Regards
Regards
-

roobre - Posts: 11
- Joined: Sat Sep 05, 2009 5:14 pm
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests



