Application module decimal localization
See original GitHub issueHi,
I try to send ajax request to AppService with model that has decimal property and my UI culture is “ro-RO”. I get this error:
Method arguments are not valid! See ValidationErrors for details.
AbpValidationException: Method arguments are not valid! See ValidationErrors for details.
Următoarele erori au fost detectate in timpul validării.
- Could not convert string to decimal: 1.000,00. Path 'suprafataTeren', line 1, position 628.
- Could not convert string to decimal: 1.000,00. Path 'suprafataConstructie', line 1, position 662.
STACK TRACE: at Abp.Runtime.Validation.Interception.MethodInvocationValidator.ThrowValidationError()
at Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate()
at Abp.AspNetCore.Mvc.Validation.AbpValidationActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
If i pass it the same model using form submit to the controller it works fine. I think is something about DecimalModelBinder culture: https://github.com/aspnetboilerplate/aspnetboilerplate/blob/e0ded5d870/src/Abp.Web.Api/WebApi/AbpWebApiModule.cs#L146 If i change to English this works also fine in my AppService.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Localized decimal numbers format - python
I want to print a number in a localized format with a thousands separator and two decimal digits. import locale locale.setlocale(locale.LC_ALL, ...
Read more >Decimal fixed point and floating point arithmetic
The decimal module provides support for fast correctly rounded decimal floating point arithmetic. It offers several advantages over the float datatype: Decimal ......
Read more >Localization
When you start an application, the system sets a default locale that the application uses to determine what decimal points and thousands separators...
Read more >Customizing Formats (The Java™ Tutorials > ...
This class allows you to control the display of leading and trailing zeros, prefixes and suffixes, grouping (thousands) separators, and the decimal separator....
Read more >How to deal with international data formats in Python
Handling the different decimal separators and date formats may seem like a hassle until you get acquainted with Python's locale module.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I solve this issue by adding this json convertor:
And in startup.cs:
Related to https://stackoverflow.com/a/57221444/2327332
This is in my log after request: