-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floating point numbers that end in .0 cannot be added to blocks #157
Comments
This is caused by the original scratch-blocks and modern Blockly implementations for decimals being very different- scratch-blocks has a custom rolled(?) regex implementation that simply checks for periods in the string. Blockly has a more robust approach that ends up stripping that "unneeded" decimal that VM relies on for the random behavior. I believe it happens here Edit: this behavior was briefly fixed in #54 but was reverted |
Expected Behavior
It should be possible to create a
pick random (1.0) to (10)
block. (This makes the block output a floating point number instead of an integer.)Screenshot from regular Scratch
Actual Behavior
Whenever you enter
1.
or1.0
into a block, it autocorrects to "1".Steps to Reproduce
Operating System and Browser
Windows 11 on MS Edge 128
The text was updated successfully, but these errors were encountered: