What do I do when I want an integer? (resolved)
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
What do I do when I want an integer? (resolved)
Now that we're in Fractionoth, which is cool, but I'm getting weird stuff like shops with items worth 15.5 gold. So, how do I round? Also, can I truncate if I don't want to round?
Last edited by Ken_Oh on March 1st, 2009, 4:52 pm, edited 1 time in total.
Re: What do I do when I want an integer?
Sure, you can split the string with [set_variables] [split].Ken_Oh wrote:Now that we're in Fractionoth, which is cool, but I'm getting weird stuff like shops with items worth 15.5 gold. So, how do I round? Also, can I truncate if I don't want to round?
Re: What do I do when I want an integer?
I don't know much about it, but if you are [set_variable]ing, wouldn't the round attribute do it?Ken_Oh wrote:Now that we're in Fractionoth, which is cool, but I'm getting weird stuff like shops with items worth 15.5 gold. So, how do I round? Also, can I truncate if I don't want to round?
Truncating isn't supported, you'll have to floor your value
ok, zookeeper replayed before me ... but is that actually a string?
~ I'll heal you by 4 hp if you post next to me ~
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
Have a look at the Era of Strife, featuring Eltireans, Eventide, Minotaurs, Saurians and Triththa
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: What do I do when I want an integer?
I'm reading about [split] now in the wiki. I don't understand it, but I'm sure I can play with it and figure it out.
Liz: Does round exist? I don't see it in the wiki. Again, I'll test it out sometime, but the g/f wants the laptop now.
Liz: Does round exist? I don't see it in the wiki. Again, I'll test it out sometime, but the g/f wants the laptop now.
Re: What do I do when I want an integer?
This is how it works these days, I forgot to update the wiki, will do that now.