Round to the next 10'th

Hi, i would like to round every number to the next 10:

image

330 -> 330
346,5 -> 350
363 -> 370
379,5 -> 380
396 -> 400

Any way to do this? Round does not seem to work for me…

Thanks in advance

Pufferfish plugin has a feature…

1 Like

You can also use this

num.gh (8.5 KB)

Thank you lots for your reply. However, i think it is a disadvantage to use a plugin when you need to share the file.

3 Likes

Thank you!

Actually, based on your post the proposed is not what you seem to be after, seems you want to be going to the next 10th (ceiling). You say 363 -> 370, in the other methods it is giving you 360 which is nearest.

The Pufferfish one has nearest, floor, and ceiling options or you can do it simply like the following:


RoundToFactor.gh (7.5 KB)

If you do in fact want nearest, just plug N from Round into B from Multiplication instead of plugging in C from Round.

If you wonder why I made a component for it in Pufferfish, it is because I can override the midpoint rounding behaviors to be Away From Zero rather than rounds default which is To Even, for more consistency in the factor rounding on numbers with midway decimals.