Radzen numeric could support both comma and dot as decimal separator #783

Closed
opened 2026-01-29 17:43:16 +00:00 by claunia · 6 comments
Owner

Originally created by @Foitn on GitHub (Mar 29, 2023).

Within several Europeans countries it is the default to use ',' instead of '.' for their decimal separator.
This means that when my colleagues want to enter a value from Europe, the copy and paste some value like '1234,45'.
Then when they copy a value from the US, this will be something like '1234.45'

When I enter the '1234,45' the comma is simply removed and the total value will become '123445'.
Could a property be added like AutoReplaceCommaWithDot or something like that, which will allow my colleagues to use both the command and dot as decimal separator?

Originally created by @Foitn on GitHub (Mar 29, 2023). Within several Europeans countries it is the default to use ',' instead of '.' for their decimal separator. This means that when my colleagues want to enter a value from Europe, the copy and paste some value like '1234,45'. Then when they copy a value from the US, this will be something like '1234.45' When I enter the '1234,45' the comma is simply removed and the total value will become '123445'. Could a property be added like `AutoReplaceCommaWithDot` or something like that, which will allow my colleagues to use both the command and dot as decimal separator?
Author
Owner

@enchev commented on GitHub (Mar 30, 2023):

Hi @Foitn,

In our opinion your pull request will not solve the problem since if the copied value have thousands separator you will get wrong value again.

@enchev commented on GitHub (Mar 30, 2023): Hi @Foitn, In our opinion your pull request will not solve the problem since if the copied value have thousands separator you will get wrong value again.
Author
Owner

@Foitn commented on GitHub (Mar 30, 2023):

@enchev I do agree on that.

In that case it feels like there is no proper way to do this.
Do you agree or maybe you have another solution?

@Foitn commented on GitHub (Mar 30, 2023): @enchev I do agree on that. In that case it feels like there is no proper way to do this. Do you agree or maybe you have another solution?
Author
Owner

@akorchev commented on GitHub (Mar 30, 2023):

Probably the correct solution is to set the culture of the application to the one of the user. Then the .NET number parsing logic should work with the right decimal separator. Another option is to not accept numbers that have the "wrong" separator. A RadzenRegexValidator can probably help with that.

I agree that the situation is far from ideal at the moment. We will research if there is a better way to handle that.

@akorchev commented on GitHub (Mar 30, 2023): Probably the correct solution is to set the culture of the application to the one of the user. Then the .NET number parsing logic should work with the right decimal separator. Another option is to not accept numbers that have the "wrong" separator. A RadzenRegexValidator can probably help with that. I agree that the situation is far from ideal at the moment. We will research if there is a better way to handle that.
Author
Owner

@Foitn commented on GitHub (Mar 30, 2023):

@akorchev Thank you

Like I said in the original issue, my problem is that suppliers from all over the world send us quotations.
When they come from the US, they are using the format with the dot, but when they are from europe, they are using the format with the comma.
My clients would like to simply copy and paste those values, without needing to worry about cultureinfo (I know, customers, right...)

Please let me know if you find a better way and if I can help in any way.

@Foitn commented on GitHub (Mar 30, 2023): @akorchev Thank you Like I said in the original issue, my problem is that suppliers from all over the world send us quotations. When they come from the US, they are using the format with the dot, but when they are from europe, they are using the format with the comma. My clients would like to simply copy and paste those values, without needing to worry about cultureinfo (I know, customers, right...) Please let me know if you find a better way and if I can help in any way.
Author
Owner

@akorchev commented on GitHub (Mar 30, 2023):

@Foitn does the built-in InputNumber work as expected for you? If it doesn't then there may not be a solution apart from using the user's culture to set the .net current culture. More info available here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/localization/select-language-culture?view=aspnetcore-7.0

@akorchev commented on GitHub (Mar 30, 2023): @Foitn does the built-in InputNumber work as expected for you? If it doesn't then there may not be a solution apart from using the user's culture to set the .net current culture. More info available here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/localization/select-language-culture?view=aspnetcore-7.0
Author
Owner

@Foitn commented on GitHub (Mar 30, 2023):

Thank you guys, I agree that this solution is better!

@Foitn commented on GitHub (Mar 30, 2023): Thank you guys, I agree that this solution is better!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#783