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

Number of digits do not increase if necessary #5

Closed
drahkrub opened this issue Jun 29, 2018 · 8 comments
Closed

Number of digits do not increase if necessary #5

drahkrub opened this issue Jun 29, 2018 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@drahkrub
Copy link

See https://codepen.io/bgraves/pen/gKZwYP - after hitting plus two times, 00 is shown.

@gaoryrt
Copy link
Owner

gaoryrt commented Jun 29, 2018

That's because your given from(80) is a 2-digit number, and shown 00 is the last 2-digit of 100 (80 + 10 + 10).

As a flip scoreboard won't change it's number of digits in real world,
the number of digits won't change too since the Flip instance created, that would be the maxLenNum of options' given from and to.

I've though it before and it's made to be that way:
It is confusing if the number of digits is changing when user already thought it is a 2-digit flip scoreboard.

I'd like to make the maxLenNum a param in options, instead of changing the number of digits suddenly.

@drahkrub
Copy link
Author

Ok, making maxLenNum a param would be an improvement at least. But why limit yourself to the "real world"?! ;-) Without the ability of changing the number of digits if needed, this very nice lib is not usable if the maximal number (or max. maxLenNum) is unknown in advance. Or one has to live with a lot of leading zeros which looks ugly.

@drahkrub
Copy link
Author

Ok, 'not usable' was a little bit harsh and most of the time the maximal number to be displayed is known in advance, so maxLenNum as a param would be a nice improvement. 👍
Another idea: What about introducing a flag which toggles the display of leading zeros as blanks (to avoid the ugliness of several leading zeros)?

@gaoryrt gaoryrt added the enhancement New feature or request label Jun 29, 2018
gaoryrt added a commit that referenced this issue Jun 30, 2018
@gaoryrt
Copy link
Owner

gaoryrt commented Jun 30, 2018

It is a little bit weird for me seeing number decrease and leading zeroes disappear in a sudden.

@drahkrub
Copy link
Author

drahkrub commented Jul 2, 2018

Leading zeros should not disappear, they should not be visible at all: "120" minus 40 leads to " 80" (blank in first place). I would use such a flag... ;-)

@hyfdemo
Copy link

hyfdemo commented Oct 9, 2018

new Flip({
maxLenNum:5
...
});
I tried like this , but number of digits didn't increase with the number ? how to solve , please ?

@gaoryrt
Copy link
Owner

gaoryrt commented Oct 9, 2018

new Flip({
maxLenNum:5
...
});
I tried like this , but number of digits didn't increase with the number ? how to solve , please ?

make sure that maxLenNum only works under branch maxLenNum instead of master

@gaoryrt
Copy link
Owner

gaoryrt commented Oct 31, 2018

for more discussion of invisible leading zeros, see #12

@gaoryrt gaoryrt closed this as completed Oct 31, 2018
@gaoryrt gaoryrt added the good first issue Good for newcomers label Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants