Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » Floor of ()
- supermarionumber1
-
Scratcher
38 posts
Floor of ()
([ floor] of (?))
How do you use this block I've seen it being used a lot but I doen't know how I can use it!





- MindingBinding
-
Scratcher
61 posts
Floor of ()
Floor will take a number, and round it down to the nearest whole number
Anything from 1 to 1.999999… will become 1, anything from 2 to 2.999999… becomes 2
Anything from 1 to 1.999999… will become 1, anything from 2 to 2.999999… becomes 2
- Zoomer_X
-
Scratcher
500+ posts
Floor of ()
([floor v] of (9) :: operatorsis a block that round decimals down. For instance, floor of 7.1 is 7. Floor of pi (3.14159265) is 3. It basically gets rid of the decimals.
- dogwithabome
-
Scratcher
100+ posts
Floor of ()
How would it be useful in a game?it would be more usefull on some complicated math stuff. on games it could round the score but using the round block is better .
- awesome-llama
-
Scratcher
1000+ posts
Floor of ()
How would it be useful in a game?There are times when you want just the whole number part of a number. Rounding may not be what you want in some cases. Say I have the number 42.87. If I round, I get 48, but if I use the floor block, I get 42.
I can think of one example for its use right now - approximate numbers. You've probably seen in many places when numbers are rounded to significant numbers, say 1,000 or 1,000,000.
If I have the number 670145, I could, using the floor block, make it 600,000. With a join block and alterations to that script, I could also make it display 600K. If you had 670145 of something, is it better to say you have 600,000 of it or 700,000 of it? Usually, rounding down to the lower number is more correct, and rounding up would end up a lie.
In fact, I already have made this script in a project.
Right here:

This script displays shortened numbers, so k for one thousand, m for one million, b for one billion, etc.
- gosoccerboy5
-
Scratcher
1000+ posts
Floor of ()
If you want to learn more about this kind of thing I suggest you check out the Wiki.
edit: editing because I don't want to post on a solved topic, but ok
can be worked around with
edit: editing because I don't want to post on a solved topic, but ok
can be worked around with
((n) - ((n) mod (1)))
Last edited by gosoccerboy5 (Nov. 16, 2020 18:33:27)
- Basic88
-
Scratcher
1000+ posts
Floor of ()
lets start off with it has noting to do with the floor. Basically it cancels out the decimal part of a number. Example: the floor of pi is 3. Even though it is very long, the long part is in the decimal, so it can be canceled out.
- GIitchInTheMatrix
-
Scratcher
1000+ posts
Floor of ()
What does the “mod” block do?Please don’t necropost
O believe it shows the remained of number 1 divider by number 2
- medians
-
Scratcher
1000+ posts
Floor of ()
What does the “mod” block do?This topic is dead, so you would have to post a new topic, but it returns the remainder when dividing the first number by the second.
- Discussion Forums
- » Questions about Scratch
-
» Floor of ()