Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Double value is not converted correctly during post to service #11434


User avatar
0
ricardo created

Hi,

When sending double value to the service, it loses formatting.

Dto:

View Code:

Form:

before sending

Service:

the value is returned to the service without format

what am I doing wrong?


9 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi **@ricardo **

    Does that work if you use . instead of , ? For example 67.67 ?

  • User Avatar
    0
    ricardo created

    Hi **@ricardo **

    Does that work if you use . instead of , ? For example 67.67 ?

    Hi @ismcagdas

    if use . it works. But the defined language is pt-br where the decimal separator is , How can I adjust so that , is correctly sent to the service?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ricardo

    Normally, this is directly handled by ASP.NET Core. There might be a problem on seding the value to server. Could you share the post data of this request by opening the browser's network tab ?

  • User Avatar
    0
    ricardo created

    Hi @ismcagdas

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks. But, to see the post data, you need to go to "conteúdo" tab and share the post data. Could you share it ?

    Thanks,

  • User Avatar
    0
    ricardo created

    Hi,

    Sorry, it's in the second uploaded image:

    The example is in standard mode, in PT-BR.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks. I have reproduced this problem. Please follow https://github.com/aspnetzero/aspnet-zero-core/issues/4733

  • User Avatar
    0
    ricardo created

    Hi, ismcagdas

    Thanks.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    In the meantime, you may create a helper function to replace , with . in your double values and you can remove it when the problem is fixed.