© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago
Hass

FormCollection converting value from input='text'

I'm trying to pass a value (a decimal one, more specifically) through an
input="text"
input="text"
(see attachment) , from a form. But when I submit it, apparently it converts the value to integer, and when I look at the input value in the FormCollection, it just discards the decimal point ".". I've tried with letters as well, it converts the text to a 0.

For example:
Let's say that the
value
value
of the input is 152.33. I hit submit on the form. But when I look at its value on the FormColletion, it is now "15233" (type string).

I've tried as well using "," instead of "." to separate decimals. No luck.
I'm using
method="post"
method="post"
to handle the form submit.

Any ideas, please? I've already spent hours trying to understand this behaviour but no success
image.png
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

✅ Converting value to nullable
C#CC# / help
3y ago
Input value always comes ""
C#CC# / help
2y ago
WPF TextBlock Text binding
C#CC# / help
2y ago