-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
[blockly] Enhance 'round' block to allow setting decimal places #1303
Comments
/cc @stefan-hoehn |
All the math blocks are currently standard math blocks, so I need to reimplement and replace it. Other than that it should be a big topic. I'll put it onto my list a soon as the following PR has been merged: |
@digitlength
AFAIK there is no way to tell JS to ceil or to floor to a given number of decimal places and round just rounds as necessary. The option we would have is to add a fourth option "toFixed" which behaves as round but with a given number of digits. In that case the block has to mutate its visual representation only then to provide the choice of input for the decimal places. |
Sounds reasonable to me. |
I have just checked the mdn web docs and can't find such a method on the Math class, so I guess there is no such method.
Sounds good 👍 |
The problem
At the moment the 'round' maths block rounds to the nearest integer.
Your suggestion
Enhance this block to allow setting a user definable number of decimal places. And at least two so that currency values make sense!
Your environment
Additional information
The text was updated successfully, but these errors were encountered: