Add two options for number inputs: require integer and require positive

Add an option for number inputs: require integer and require positive.

require integer means that people are not able to place a decimal point to the number input.
require positive means that people are not able to place a minus sign to the number input.

I'm requesting this because in Scratch, there are some inputs where you can NOT place a . or a - in their number inputs, like the following blocks:
repeat (10) { }
Decimal points and minus signs cannot be placed in the repeat block first number input.
wait (1) seconds
Decimal points are allowed, but not the minus sign.
go [forward v] (1) layers
Minus signs are allowed, but not the decimal point.

Now what if you can make an input that behaves like the number inputs from the above? That would be cool.

There are workarounds to do this, like:
untitled script pic (57)
...for disallowing negative numbers.

untitled script pic (58)

...for disallowing non-integers.

untitled script pic (59)

...for disallowing both.

But that would require significant changes, so an option was considered. Would it be a good idea?

I don't understand this part. Your solutions look great to me.

Well, keeping in mind that you're only talking about numbers the user types directly in the input slot, as opposed to values computed by a reporter.

the workaround is perfectly easy tho

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.