Discuss Scratch

PyrosTheStickman
Scratcher
23 posts

Rounding to the nearest whole number?

Is there a way to make a value represent the nearest whole number to something? Example: if I have “17” and want half of 17 rounded to the nearest whole. Half of 17 is 8.5, but I want 9, the nearest whole number. Is there a way to do this in Scratch yet?
drmcw
Scratcher
1000+ posts

Rounding to the nearest whole number?

round
Sigton
Scratcher
1000+ posts

Rounding to the nearest whole number?

roundFloorofCeilingof

Sigton
streamline1
Scratcher
79 posts

Rounding to the nearest whole number?

You can use:
roundyourNumber

Or:
floorofyourNumber+0.5

There are probably other ways. Just stick to the round block.

-Streamline1
zsprojects
Scratcher
14 posts

Rounding to the nearest whole number?

mod0androundarethemainoperators
Cryptic_Lynx
Scratcher
36 posts

Rounding to the nearest whole number?

Is there a way to round to the nearest 10, like if you have 23, have the script round to 20?
BF10
Scratcher
500+ posts

Rounding to the nearest whole number?

Cryptic_Lynx wrote:

Is there a way to round to the nearest 10, like if you have 23, have the script round to 20?
round23
drmcw
Scratcher
1000+ posts

Rounding to the nearest whole number?

Cryptic_Lynx wrote:

Is there a way to round to the nearest 10, like if you have 23, have the script round to 20?
10*round/10
PyrosTheStickman
Scratcher
23 posts

Rounding to the nearest whole number?

I'll probably stick with the Round block for the time being. Thanks guys.

Powered by DjangoBB