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

Allow omitting leading 0 in floating-point number fields #304

Closed
vaadin-miki opened this issue Jul 22, 2021 · 0 comments · Fixed by #307
Closed

Allow omitting leading 0 in floating-point number fields #304

vaadin-miki opened this issue Jul 22, 2021 · 0 comments · Fixed by #307
Assignees
Labels
enhancement New feature or request

Comments

@vaadin-miki
Copy link
Owner

vaadin-miki commented Jul 22, 2021

It should be possible to enter .5 and have it automatically converted to 0.5. It should also work with negative numbers (-.5 being -0.5).

The feature is controlled through:

  • setIntegerPartOptional(boolean) and isIntegerPartOptional(), with the default value being false (so integer part is required)
  • withIntegerPartOptional(boolean) and then as helpers withIntegerPartOptional() and withIntegerPartRequired()

This idea was suggested by Holger Hähnel in the Vaadin Directory.

@vaadin-miki vaadin-miki self-assigned this Jul 22, 2021
@vaadin-miki vaadin-miki added the enhancement New feature or request label Jul 22, 2021
@vaadin-miki vaadin-miki added this to the Next release milestone Jul 22, 2021
vaadin-miki added a commit that referenced this issue Aug 9, 2021
vaadin-miki added a commit that referenced this issue Aug 9, 2021
changed API to say "optional" rather than "required" (default behaviour is still "required")
vaadin-miki added a commit that referenced this issue Aug 10, 2021
vaadin-miki added a commit that referenced this issue Aug 10, 2021
controlled through `setIntegerPartOptional` and related getter and with- methods
vaadin-miki added a commit that referenced this issue Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant