© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
Loan

ASP.NET Web API doesn't parse floating numbers with a '.'

Hi everyone, I have a quick question about ASP.NET
I am scratching my head over this for an hour now.

Why when I ask a simple float number in my controller and I give for exemple ''12.547" it does not get parsed and just returns to the calling client this response:
{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "traceId": "00-975a6f23fd686e43f96af5532f544f5b-83eec17e49f1b737-00",
    "errors": {
        "Time": [
            "The value '1572.752214' is not valid for Time."
        ]
    }
}
{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "traceId": "00-975a6f23fd686e43f96af5532f544f5b-83eec17e49f1b737-00",
    "errors": {
        "Time": [
            "The value '1572.752214' is not valid for Time."
        ]
    }
}


It might be a culture problem, because my computer is in french, and floating numbers are formatted like '12,547' for example.
But I did not find any way of telling ASP to use the en-US culture.

Any idea? Thank you so much.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ ASP.Net Core Web API
C#CC# / help
6mo ago
NUnit test with Asp net web API
C#CC# / help
17mo ago
❔ ASP.NET Core Web API with Auth0
C#CC# / help
3y ago
✅ asp.net web api connection refused
C#CC# / help
2y ago