Base solution for your next web application
Open Closed

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


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)
  • 0
    ismcagdas created
    Support Team

    Hi **@ricardo **

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

  • 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?

  • 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 ?

  • 0
    ricardo created

    Hi @ismcagdas

  • 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,

  • 0
    ricardo created

    Hi,

    Sorry, it's in the second uploaded image:

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

  • 0
    ismcagdas created
    Support Team

    Hi,

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

  • 0
    ricardo created

    Hi, ismcagdas

    Thanks.

  • 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.