Discuss Scratch
- TriforceMayhem
-
Scratcher
27 posts
More Round block capabilities
Right now the Round block looks like this:
It could be expanded to this:
The default option would be the nearest whole number, because if it was something different, it could mess up a large quantity of projects.
I hope you take this idea into consideration!
Have a wonderful time coding!
~TriforceMayhem
(round ())This block could use some more options. Right now, it only rounds to the nearest whole number.
It could be expanded to this:
(round () to the nearest [ v])It could have options like: Nearest ten, nearest tenth, nearest thousandth, etc.
The default option would be the nearest whole number, because if it was something different, it could mess up a large quantity of projects.
I hope you take this idea into consideration!
Have a wonderful time coding!
~TriforceMayhem
Last edited by TriforceMayhem (June 25, 2016 18:04:48)
- ProjectMaker59
-
Scratcher
500+ posts
More Round block capabilities
Semi-support, Sorry
Workaround:
Workaround:
((round ((round what :: grey) / (to the nearest :: grey))) * (to the nearest :: grey))
// If you don't mean that then
((round ((round what :: grey) / (0.1))) * (0.1))
((round ((round what :: grey) / (0.01))) * (0.01))
Last edited by ProjectMaker59 (June 25, 2016 18:06:02)
- humantorch01
-
Scratcher
85 posts
More Round block capabilities
It would be nice to have the
(round ())be able to be to the nearest one, tenth, hundredth, etc. It would look like this:
(round () to the nearest [tenth v]::operators)I hope you consider this as it would be very useful.

Last edited by humantorch01 (Oct. 10, 2016 16:50:52)
- Sheep_maker
-
Scratcher
1000+ posts
More Round block capabilities
A workaround for now:
((round((#::grey)*(10)))/(10))
- awesome-llama
-
Scratcher
1000+ posts
More Round block capabilities
(round () to the nearest [tenth v]::operators) //75% supportDo this to make it green:
(round () to the nearest [tenth v]::operators)
- powercon5
-
Scratcher
1000+ posts
More Round block capabilities
While you can use the worka-round it would be nice to have a simple block. It would also not add extra blocks to scratch as you could replace the current one.
Maybe
Maybe
(round () to () places::operators)?
Last edited by powercon5 (Oct. 10, 2016 08:39:26)
- stickfiregames
-
Scratcher
1000+ posts
More Round block capabilities
While you can use the worka-round it would be nice to have a simple block. It would also not add extra blocks to scratch as you could replace the current one.
Maybe(round () to () places::operators)?
(round (...) to nearest (0.1) :: operators)would be even better if it's possible, because you wouldn't be limited to powers of 10. Unfortunately, it might not work because numbers like 0.1 can't be represented exactly, and that might cause rounding errors.
- humantorch01
-
Scratcher
85 posts
More Round block capabilities
That's why I think there should be a loadout of what you want it to be rounded to:While you can use the worka-round it would be nice to have a simple block. It would also not add extra blocks to scratch as you could replace the current one.
Maybe(round () to () places::operators)?(round (...) to nearest (0.1) :: operators)would be even better if it's possible, because you wouldn't be limited to powers of 10. Unfortunately, it might not work because numbers like 0.1 can't be represented exactly, and that might cause rounding errors.
(round ()to the nearest [tenth, hundredth, etc. v] ::operators)
- dvargasews
-
Scratcher
500+ posts
More Round block capabilities
In general the workaround for
round (x) to the nearest 1/(n)ᵗʰ ::operators reporteris
((round ((x)*(n)))/(n))
- humantorch01
-
Scratcher
85 posts
More Round block capabilities
In general the workaround forYes but it is time consuminground (x) to the nearest 1/(n)ᵗʰ ::operators reporteris((round ((x)*(n)))/(n))
- Tymewalk
-
Scratcher
1000+ posts
More Round block capabilities
While you can use the worka-round it would be nice to have a simple block. It would also not add extra blocks to scratch as you could replace the current one.I support this idea.
Maybe(round () to () places::operators)?
- duckboycool
-
Scratcher
1000+ posts
More Round block capabilities
No support, as others have said.
(round (((Input::grey) * (Factor::grey)) /(Factor::grey)))
- humantorch01
-
Scratcher
85 posts
More Round block capabilities
No support, as others have said.Sure but it is too time consuming. And most users new to scratch will not understand that.(round (((Input::grey) * (Factor::grey)) /(Factor::grey)))
- duckboycool
-
Scratcher
1000+ posts
More Round block capabilities
It is very simple and is 3 blocks. I feel neither of those are true.No support, as others have said.Sure but it is too time consuming. And most users new to scratch will not understand that.(round (((Input::grey) * (Factor::grey)) /(Factor::grey)))
- humantorch01
-
Scratcher
85 posts
More Round block capabilities
Then I guess we have different viewsIt is very simple and is 3 blocks. I feel neither of those are true.No support, as others have said.Sure but it is too time consuming. And most users new to scratch will not understand that.(round (((Input::grey) * (Factor::grey)) /(Factor::grey)))
- jromagnoli
-
Scratcher
1000+ posts
More Round block capabilities
This is actually a pretty good idea. As for the workaround, I hate to sound dumb, but I never thought of that. Also maybe you could add:
(round () to the nearest [tenth v]::operators)And leave it at that.
(round () to the nearest [hundreth v]::operators)
(round () to the nearest [thousandth v]::operators)
- WolfCat67
-
Scratcher
1000+ posts
More Round block capabilities
Hmm… Maybe the block could look like this?
round (15.12901928571) to nearest [thousandth v] :: operators reporterIt should also be able to do this:
round (15.12901928571) to nearest [ten v] :: operators reporterThis would allow it to not only round to decimal places, but also numbers like 10, 100, etc.
- customhacker
-
Scratcher
1000+ posts
More Round block capabilities
Semi - Support, there is a workaround, though slightly more complicated.
- redgreenandblue
-
Scratcher
100+ posts
More Round block capabilities
I think it should be more like
(round () to the nearest ()::operators)so you can do things like
(round (23) to the nearest (12)::operators)This would report 24
Last edited by redgreenandblue (Feb. 1, 2017 15:24:43)













