SynthMaker

Truncate or round float resolution?

Archive · 2005 14 old posts

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].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.