Kingston ·
Hi.
How do I truncate or round floats?
For example if I need to display say, 0.3335523678 as 0.33
thanks
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
Kingston ·
Hi.
How do I truncate or round floats?
For example if I need to display say, 0.3335523678 as 0.33
thanks
oddson ·
To round for display use the Format component.
This thread will show you how.
[It starts with me asking for this and ends with Malc saying it's done and how to use it.]
Kingston ·
Perfect.
Thanks.
infuzion ·
dang, I didn't even know that component existed.
oddson ·
There's only 271 primitives. You don't know them all? 😉
According to the docs there are 11. Hmm. 😈
skOre ·
Heh, we could start a 271/5 part series - "Better know your primitives", where everybody would share what he found out about the primitives...
I think this is a great idea and I will start right now 🙂
oddson ·
Can they have their own directory? (or whatever it's called in blog land).
edit - yeah OK a separate forum, then what's the whole thing called?
skOre ·
Not sure what you mean O_o you mean a seperate forum ?
infuzion ·
skOre wrote: Not sure what you mean O_o you mean a seperate forum ?
Right now we have "General, Graphics, Sound, Examples". He wants a new forum, prob named "Docs", or "Tutorials" or something... but why not use the wiki for that, once it gets fixed?
skOre ·
well, a because its not fixed 😉 and b because the forum is much more frequented atm and thus a better solution if you want to get feedback/info from other users.
Yet a tutorials forum might be neat.
infuzion ·
skOre wrote: Yet a tutorials forum might be neat.
Thinking about it, tutorials are already in General, Audio, Graphics. Might be better that a Docs forum be made... then again, only the orginal author can edit the orginal post, then we'll end up with a ton of outdated posts (since things in SM change so much)... which is way a WiKi is better; anyone can update them 😉
skOre ·
yeah, wiki will be a way to go for my tutorials, yet for now, I think its nice to have them in the forum. (Newbs will find them quicker this way as well.)
rl ·
additionally it would be great, if the WIKI would allow uploading osm files and images. Then everything would be at it's place.
Tom7777 ·
For example if I need to display say, 0.3335523678 as 0.33
For general use theres a simple way to get 0.3335523678 as 0.33. What you need to do is send the float value into a Float Multiply with a value of 100 you then send this through a Int data type, now use a float divide with a value of 100, this will have rounded the value. You can then just make a simple custom module if you need this for something else.
Wrote something here? To have a post removed or your name hidden, write to [email protected].