Discuss Scratch

EIephant_Lover
Scratcher
500+ posts

Easier way to choose what to round to

Okay, so I am well aware there is a way around this, but for newer Scratchers (or Scratchers who aren't very good at coming up with logical workarounds), this can be immensely confusing. With the “round ()” block, it always, always rounds to the nearest whole number. The block should be revamped to look like this:
([round v] (13.3235) to [0.01] ▲▼ place :: operators)
With this block, the up and down buttons change the “0.01” to different numbers, e.g. if you clicked the up arrow it would change to 0.1 and the down arrow would change to 0.001. This is a non-editable text field.

So here's a run-down of how it would work:

([round v] (13.3235) to [0.01] ▲▼ place :: operators  // Reports 13.32
([round v] (13.3235) to [0.1] ▲▼ place:: operators // 13.3
([round v] (13.3235) to [0.001] ▲▼ place :: operators // 13.324
([round v] (13.3235) to [10] ▲▼ place :: operators // 10
([round v] (654632486) to [10000] ▲▼ place :: operators // 654630000

If you are confused about why it is a dropdown, it is so you can also use it for the “floor” and “ceiling” functions.

([floor v]  (9.38024) to [0.1] ▲▼ place :: operators // Reports 9.3
([ceiling v] (9.31024) to [0.1] ▲▼ place :: operators // Reports 9.4

This way, we could choose the place on all of those blocks.

Last edited by EIephant_Lover (May 30, 2020 03:36:04)

Botcho_Otkho
Scratcher
1000+ posts

Easier way to choose what to round to

I think it's a great idea. Would it also work if it was like this:
[round v] to the (1000) place (12395391)::operators reporter
?
EIephant_Lover
Scratcher
500+ posts

Easier way to choose what to round to

Botcho_Otkho wrote:

I think it's a great idea. Would it also work if it was like this:
[round v] to the (1000) place (12395391)::operators reporter
?
Yep, it would report 12395000.
Za-Chary
Scratcher
1000+ posts

Easier way to choose what to round to

Would it also work if it was like this?

[round v] to the (3) place (17)::operators reporter
WindOctahedron
Scratcher
1000+ posts

Easier way to choose what to round to

Za-Chary wrote:

Would it also work if it was like this?

[round v] to the (3) place (17)::operators reporter
The answer:

EIephant_Lover wrote:

The input should only allow zeroes, ones, and decimals.
Rocket-Flier
Scratcher
100+ posts

Easier way to choose what to round to

It would be easier to understand like this:
round to the (10)th place of (6783) :: operators reporter
hedgehog_blue
Scratcher
1000+ posts

Easier way to choose what to round to

Rocket-Flier wrote:

It would be easier to understand like this:
round to the (10)th place of (6783) :: operators reporter
If you remove the phrase “to the (10)th place”, you get
round of (6783)
what is the round of something? The existing block says (round ()) without saying of.
To keep with the current logic, think it should be
(round () to the ()th place::operators)
(yes, I know a reporter should be a noun and not an verb, but the current round block phrases it as an verb so this is just to keep it the same, and because round can't be used as a noun the way you are)
EIephant_Lover
Scratcher
500+ posts

Easier way to choose what to round to

hedgehog_blue wrote:

Rocket-Flier wrote:

It would be easier to understand like this:
round to the (10)th place of (6783) :: operators reporter
If you remove the phrase “to the (10)th place”, you get
round of (6783)
what is the round of something? The existing block says (round ()) without saying of.
To keep with the current logic, think it should be
(round () to the ()th place::operators)
(yes, I know a reporter should be a noun and not an verb, but the current round block phrases it as an verb so this is just to keep it the same, and because round can't be used as a noun the way you are)
I think of the original block to mean more “rounded version of ()”, so it is a noun, and still uses the “of”. Also, yes - if you remove that phrase, it does say that. But you can't remove it, because the sentence isn't “round, to the tenth place, of…”, it's “round to the tenth place of”. You are rounding to a part of the number. Take the sentence “He came in the fifth place of the race.” Now remove “in the fifth place” and the sentence says “He came of the race.” You can't just remove a part of it like that.

Why has the block suggestion become a grammar discussion about what exactly the wording should be?

Edit; You wrote “(10)th place”, which would make sense - it would be said as 10 (ten) + th, or tenth. But what if you wrote 0.1th? Would you say “zero point oneth” place, or the “one tenthth” place? Neither make sense.

Last edited by EIephant_Lover (July 2, 2019 18:05:26)

WindOctahedron
Scratcher
1000+ posts

Easier way to choose what to round to

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
EIephant_Lover
Scratcher
500+ posts

Easier way to choose what to round to

WindOctahedron wrote:

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
I think that would be confusing for newer Scratchers, to be honest that makes a little more sense.
coder2045
Scratcher
1000+ posts

Easier way to choose what to round to

WindOctahedron wrote:

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
How about
([round v] () to the nearest [0.01 v]::operators) //Options for the second dropdown: 0.001, 0.01, 0.1, 10, 100,etc.

Last edited by coder2045 (July 9, 2019 19:31:07)

coder2045
Scratcher
1000+ posts

Easier way to choose what to round to

WindOctahedron wrote:

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
What does that even mean?
Botcho_Otkho
Scratcher
1000+ posts

Easier way to choose what to round to

coder2045 wrote:

WindOctahedron wrote:

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
How about
([round v] () to the nearest [0.01 v]::operators) //Options for the second dropdown: 0.001, 0.01, 0.1, 10, 100,etc.
Meaning there would be an infinite amount of inputs. I think the one above is the clearest for New Scratchers.
EIephant_Lover
Scratcher
500+ posts

Easier way to choose what to round to

coder2045 wrote:

WindOctahedron wrote:

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
How about
([round v] () to the nearest [0.01 v]::operators) //Options for the second dropdown: 0.001, 0.01, 0.1, 10, 100,etc.
I've explained why I don't want a dropdown in the original post, I'll do it a bit shorter:
It's so the ST doesn't have to put every single number in it, and so that maybe if a Scratch wanted to round to a more or less precise number they could.
Maybe this would work better:
([round v] () to [0.1] ▲▼ place :: operators)
The up and down buttons make it more or less precise, so there isn't a dropdown but you can't type in it.

Last edited by EIephant_Lover (July 9, 2019 19:35:38)

coder2045
Scratcher
1000+ posts

Easier way to choose what to round to

Za-Chary wrote:

Would it also work if it was like this?

[round v] to the (3) place (17)::operators reporter
No offense,. Za-Chary, but it would be really strange to round something to the nearest 3 (or 7 or 11 or 3.1415…)
coder2045
Scratcher
1000+ posts

Easier way to choose what to round to

EIephant_Lover wrote:

coder2045 wrote:

WindOctahedron wrote:

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
How about
([round v] () to the nearest [0.01 v]::operators) //Options for the second dropdown: 0.001, 0.01, 0.1, 10, 100,etc.
I've explained why I don't want a dropdown in the original post, I'll do it a bit shorter:
It's so the ST doesn't have to put every single number in it, and so that maybe if a Scratch wanted to round to a more or less precise number they could.
Maybe this would work better:
([round v] () to [0.1] ▲▼ place :: operators)
The up and down buttons make it more or less precise, so there isn't a dropdown but you can't type in it.
Where did you get those buttons from?
EIephant_Lover
Scratcher
500+ posts

Easier way to choose what to round to

coder2045 wrote:

EIephant_Lover wrote:

coder2045 wrote:

WindOctahedron wrote:

I thought that it would be better if the block looked like this:
([round v] to the 1/10^() place () :: operators)
That way, the input would accept every number. However, I think that it might be confusing.
How about
([round v] () to the nearest [0.01 v]::operators) //Options for the second dropdown: 0.001, 0.01, 0.1, 10, 100,etc.
I've explained why I don't want a dropdown in the original post, I'll do it a bit shorter:
It's so the ST doesn't have to put every single number in it, and so that maybe if a Scratch wanted to round to a more or less precise number they could.
Maybe this would work better:
([round v] () to [0.1] ▲▼ place :: operators)
The up and down buttons make it more or less precise, so there isn't a dropdown but you can't type in it.
Where did you get those buttons from?
They're just a copy/paste thing on some website, they don't exist in any Scratch blocks.
BlueStarPort
Scratcher
100+ posts

Easier way to choose what to round to

Support. This would be much better than the old one, and this would put less restrictions on coding.
StrangeMagic32
Scratcher
1000+ posts

Easier way to choose what to round to

No support

all in all I would be very confused.

This makes more sense to me

((round ((1514) * (3))) / (3))

Not 100% sure if that is proper rounding, but I'd rather deal with that than

([round v] to the (1000) place (1514) :: operators


Also as far as I know this is easily work-aroundable
with
((round (() / ())) * ())
((round (() * ())) / ())

Last edited by StrangeMagic32 (July 10, 2019 21:18:28)

EIephant_Lover
Scratcher
500+ posts

Easier way to choose what to round to

StrangeMagic32 wrote:

No support

all in all I would be very confused.

This makes more sense to me

((round ((1514) * (3))) / (3))

Not 100% sure if that is proper rounding, but I'd rather deal with that than

([round v] to the (1000) place (1514) :: operators


Also as far as I know this is easily work-aroundable
with
((round (() / ())) * ())
((round (() * ())) / ())
It is workaroundable, but your first thing didn't make sense, not to be rude XD What that would do is multiply 1514 by three, and since it only rounds to the ones place, it would just divide it by three and you'd get 1514.
This is the workaround:
(round ((23.565) * (10))) / (10)
As an example, that's rounding to the tens place. This suggestion is mostly just to make it easier, and I find a single block easier than the workaround.

Last edited by EIephant_Lover (July 10, 2019 21:28:59)

Powered by DjangoBB