Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7711283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:20:09+00:00 2026-06-01T01:20:09+00:00

I have an issue with the submitted form information. Decimal parsing fails when I

  • 0

I have an issue with the submitted form information. Decimal parsing fails when I try to parse a string returned through Interner Explorer or Chrome but not on Firefox or Safari. The strings looks exactly the same in Visual Studio. I made this debugging bit:

var asd3 = collection["formValue"]; // Get it from the FormCollection
var asd4 = asd3.Replace(",", ".");  // Change the punctuation
var asd5 = Decimal.Parse(asd4);     // Make the string into a decimal
var asd6 = Math.Round(asd5, 1);     // Round it

It fails on asd5 when trying to parse the decimal out of asd4 with the error: Input string was not in a correct format.

Here’s an image of the strings. Top is Firefox and below Internet Explorer.

enter image description here

What on earth could be the problem here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:20:10+00:00Added an answer on June 1, 2026 at 1:20 am

    What on earth could be the problem here?

    Culture.

    In your debugger inspect the value of Thread.CurrentThread.CurrentCulture and you will see differences between your browsers.

    If you have a different culture set in your browser this culture will be used by ASP.NET when parsing values especially if you haven’t explicitly specified the culture in your web.config:

    <globalization culture="en-US" uiCulture="en-US" />
    

    If this is set to auto then the browser culture will be used.

    Another possibility is to force invariant culture when parsing to ensure that . (dot) will be the decimal separator.

    var asd5 = Decimal.Parse(asd4, CultureInfo.InvariantCulture); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom PHP script which uploads information submitted by a form
I have a few input fields in a form which are submitted using Save
i have a form which fills a database with an issue , the issue
I'm having an issue with my grails application. I have a form whose method
I have an issue with submitting post data. I have a form which have
Here's my issue: I have a html form that after a user fills in
I am having an issue when processing form data. When the form is submitted,
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We are new to ROR, We have issue in creating Login/Logout process in ROR
Share your ideas please! I have issue to check the folder and convert a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.