Skip to content
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

Limits number of digits to 12 in number block #3551

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -4064,6 +4064,14 @@ class Block {
this.activity.refreshCanvas();
this.value = oldValue;
}

if(String(this.value).length > 12) {
const thisBlock = this.blocks.blockList.indexOf(this);
this.activity.errorMsg(_("There can be atmost 12 digits"), thisBlock);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"at most"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please put a period at the end of the sentence.

Maybe "Numbers can have at most 12 digits."

this.activity.refreshCanvas();
this.label.value = oldValue;
this.value = oldValue;
}
} else {
this.value = newValue;
}
Expand Down
Loading