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 typing comma instead of period #4

Closed
RaphaelMarcouxCTRL opened this issue Jun 17, 2022 · 2 comments
Closed

Allow typing comma instead of period #4

RaphaelMarcouxCTRL opened this issue Jun 17, 2022 · 2 comments

Comments

@RaphaelMarcouxCTRL
Copy link

Would it be possible to allow typing comma or period as a separator?

When typing in french, we use the comma key to separate decimals and it feels counter-intuitive to have to type a period to enter a comma.

@pablopioli
Copy link
Owner

Well, the whole point of this control is this behavior. I basically had to build it from the ground to input numbers on the keypad using the Spanish conventions (as in French the comma is used for the decimal separator). The regular controls are not enough flexible to do this.

This behavior is hardcoded, but it could be parameterized. I will keep this issue open for when I have time to make the required changes, hopefully in the next weeks. In the meantime, pull requests are welcome.

@pablopioli
Copy link
Owner

Solved in version 3.

In this version I made a breaking change. I do not change the typed period by default, as I was doing in versions 1 and 2.

Now, if you wish, you can opt in to a typing facility for countries where the comma (or something else?) is used as a decimal separator.

Set the CustomDecimalSeparator parameter to a comma
CustomDecimalSeparator=","
The control will capture the decimal point in the numeric keypad (only this key) and replace it with the value specified.

You can add this feature to all your textboxes setting
NumericTextBoxDefaults.CustomDecimalSeparator = ","
in you application startup

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

2 participants