ScratchData LogoScratchData
Back to superbuddy2's profile

Rounding Numbers To The Nearest 10, 100, 1000...

SUsuperbuddy2•Created October 21, 2022
Rounding Numbers To The Nearest 10, 100, 1000...
1
1
15 views
View on Scratch

Instructions

Click 'See Inside' for code. Uses only one stack block. Detailed Explanation: Put a random number in the first slot and put a round number (e.g. 10, 100, 1,000...) in the second slot. As an example, say 32 is in slot 1 and 10 is in slot 2. It divides by the round number (10) which gives you 3.2. Then we use the Scratch round block to round the number (3.2 rounds to 3). After that, we multiply that by the round number (10), and that gives you 30. 32 rounded to the nearest 10 is 30!

Description

Found by myself. Feel free to use in your own projects (please give credit). You can also use it round to decimal places. If you try to round to the nearest two, for example, it will round to the nearest multiple of two.

Project Details

Project ID749399980
CreatedOctober 21, 2022
Last ModifiedMarch 9, 2024
SharedOctober 21, 2022
Visibilityvisible
CommentsAllowed