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

Make decimal optional #48

Closed
ingro opened this issue Mar 31, 2017 · 3 comments
Closed

Make decimal optional #48

ingro opened this issue Mar 31, 2017 · 3 comments
Milestone

Comments

@ingro
Copy link

ingro commented Mar 31, 2017

Hello and thanks for this slick library! I have a request though:

I need to format a number like currency, so it should allow at the most 2 decimals but the should not be required.

So if I type, for example, 42 it should not add .00, but if the user begin to type decimal it should limit them to 2.

This can be achieved with the current version only with decimalPrecision set to false but in that way I can't limit the decimal to 2.

Do you think that could be a reasonable feature to add in the future?

Thank you.

@sinaler
Copy link

sinaler commented Sep 25, 2017

Oh please this is also what I need. +1

@s-yadav s-yadav mentioned this issue Oct 17, 2017
18 tasks
@s-yadav s-yadav added this to the 3.0.0 milestone Oct 17, 2017
@s-yadav
Copy link
Owner

s-yadav commented Oct 17, 2017

Coming up in v3.0.0

s-yadav added a commit that referenced this issue Oct 17, 2017
- Added fixedDecimalScale prop to add 0s to match decimalScale
- Handle some formatting on onBlur event. This will allow user to intermediately type incomplete number (i.e. leading zeros, no zeros before decimal) (Fix for #96)
@s-yadav
Copy link
Owner

s-yadav commented Oct 17, 2017

Changes on v3.0.0-alpha3

@s-yadav s-yadav closed this as completed Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants