Floating number binding goes wrong in different cultures
I have an entity that has decimal properties.
When I create new records int different cultures, floating point properties parsing wrong.

I send with .(dot) in Turkish also. But in Turkish culture floating points represented with ,(comma)

May framework support to handle it by custom modelbinder or it is required to implement individually?
hi @cotur Which project can reproduce this problem?
By default, the model binding uses invalid culture in querystring and router to get the value, and uses the current culture to get the value in the form.
This may cause some potential binding issues. For example, we can't use the culture format (time and currency, etc.) to pass parameters in the querystring.
Solution:
-
We can use
jsonto pass request parameters. Because the number format in json is fixed. But this requires more coding. -
We can format the parameters according to the current culture in the js code and then pass it to the server.
eg: parseFloat("516.89").toLocaleString(abp.localization.currentCulture.cultureName) -
We can also write some custom model bindings on the server side to be compatible with some situations, but we cannot cover all.
In short, it is not easy for an application to work flawlessly in different cultures.
@cotur @hikalkan What do you guys think?
It seems it is related to UI (jquery validation) rather than the server side. Please create a new issue if you need.