View Single Post
Number string with no decimal without "int as string" (solved)
Junior Member
Status: Offline
Posts: 7
Join Date: Jan 2013
Location: Kapolei, Hawaii
Default Number string with no decimal without "int as string" (solved) - 04-10-2013, 10:04 PM

Well, I thought of one way of doing it. Make a string list of the digits 0-9 and use the list to build the number string.

In my current case I needed to make a timer for class with both minutes and seconds (count down timer). So I first separrated the time into minutes and seconds variables, then I converted those to strings by pulling characters from my integerStrings list.

For the 2 digit seconds counter I used:
secondsString set value to ( ( item ( floor ( ( timer.seconds / 10 ) ) ) from timer.integerStrings ) joined with ( item ( ( timer.seconds - ( ( ( floor ( ( timer.seconds / 10 ) ) ) * 10 ) ) ) ) from timer.integerStrings ) )
Same thing with different variables for minutes.

When minutes dropped to single digit I used:
minutesString set value to ( item timer.minutes from timer.integerStrings )
Then I just combine them with a colon in the middle.

Don't know if anyone else is still using v2.0 without the "int as string" function, but if you are, this is a way to get your number strings without decimals.

Of course it would be easier of my school would just upgrade to a newer version with the function. I'm using v2.3 at home, and was quite surprised when I got to class and found my code would not load. So far that's the only incompatibility I've found (other than a bug in 2.0 that's fixed in 2.3). All the other stuff I've written has worked in class.

Last edited by CellularDecay; 04-10-2013 at 10:10 PM.
Reply With Quote