-
Notifications
You must be signed in to change notification settings - Fork 25
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
Badge Display: Display Print Number -> Leftover leading/trailing digit(s) #1692
Comments
I think the issue here is that the oledprint() lacks a formatter that defines the width of the output. I expect that this would also happen when the previous displayed value contains more digits that the current display value. For example, display "123" followed by "5" should cause the display to render "125". |
Thank you, @francisbauer @MatzElectronics @zfi @Steph-Parallax - This is a common problem when it comes to updating displays with changing numbers (and strings) in-place. I think we should consider a general purpose way to handle it that can apply to many situations, like:
There are many formatting options possible, so it should probably be a customizable-option block to be as simple or as sophisticated as the user needs. The resulting output can just be displayed on the device in the place of a previous output, over and over again, and it will automatically overwrite what was in that entire space before. NOTE: The features above need not apply only to numeric strings, but also alpha and alphanumeric. |
Right, if the position of the new value is being altered to "right-justify," but most naturally it ends up as rendering "523". A string formatter block could make it turn into |
This should be handled by a new simple-library function first, and it can then be brought out to the blocks. It could be: |
When trying to display a count-down of a numeric variable (such as: repeat item from 10 to 1 by -1) using the Display Print Number routine and a constant Display Set Cursor position, the trailing 0 from the 10 is left when the 9 to 1 digits are printed. So on the display you see 10, 90, 80, ...
The following blocklyprop code (translated) demonstrates the issue and also what I did as a work-around, (see the if statement).
The text was updated successfully, but these errors were encountered: