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 6047357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:20:32+00:00 2026-05-23T07:20:32+00:00

This post is about C# and .Net, but some info is valuable for other

  • 0

This post is about C# and .Net, but some info is valuable for other techonolgies.

Since I can remember, I’ve been having problems with apps or games that crash because of a different style of parsing decimal numbers. It happens very often, from CAD apps, libraries to web pages. I’m not sure whether it is ignorance or lack of knowledge, but it’s really annoying.

What’s the problem? Here is a wiki article about it, but it short:

Here is a map that shows what kind of decimal separator (decimal mark) is used around the world.
map of diffrent decimal separator

Decimal marks:

  • Period — Blue
  • Comma — Green
  • Non-West-Arabic Numerals — Red
  • Unknown — Grey

Most of the Europe, South America write 1 000 000,00 or 1000000,00 sometimes 1.000.000,00 as opposite to “imperial” (marked as blue) write 1,000,000.00

Let me just give you a few from all problems that I encoutered last month.

  1. Number on webpages hard to read: Let’s take one of the most viewed YT videos.
    It shows me 390159851. Number above one million are very hard to read, what’s the order of magnitude? Is it 39 mln or 390?
  2. Mirosoft XNA for Windows Phone 7 example: There is a very neat class that parse XML file to produce XNA animation

    /// <summary>
    /// Loads animation setting from xml file.
    /// </summary>
    private void LoadAnimiationFromXML()
    {
        XDocument doc = 
                  XDocument.Load("Content/Textures/AnimationsDefinition.xml");
        XName name = XName.Get("Definition");
        var definitions = doc.Document.Descendants(name);
    
    
            if (animationDefinition.Attribute("Speed") != null)
            {
                animation.SetFrameInvterval(TimeSpan.FromMilliseconds(
                    double.Parse(animationDefinition.Attribute("Speed").Value)));
            }
    

    double.Parse throws an exception, one simple soultion is to use XmlConvert.ToDouble(); or parse with InvariantCulture.

  3. .Net app that use CSV files to store input vector as CSV – also throws.

  4. Another .Net app that has some parsing inside the class – throws.

So how can we fix this?

  • Fix the bug in code – possible only with avaible source code and tedious.
  • Change the data (CVS, XML etc.) – even with possible, not very happy with mutating the data.
  • Change the OS default decimal separator – not gonna happen.

Is there any other way to slove this? Can I make the app be invariant? Like starting the app in a different environment.

PS. I would like to run the app, but I don’t have the code.

  • 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-05-23T07:20:32+00:00Added an answer on May 23, 2026 at 7:20 am

    Properly set Thread.CurrentThread.CurrentCulture and you wont have such problems.
    Read here how to write culture independent code.

    EDIT:
    If you do not have access to the code, you can run the application under a user account which has the expected culture set. For quick access you could create an english user, a german user, a french user..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
So this post talked about how to actually implement url rewriting in an ASP.NET
I just read this post about why new-line warnings exist, but to be honest
This question is related to the post about having abstract at the titlepage. I
I was reading this thread/post: https://stackoverflow.com/questions/262298/windows-c-ui-technology and am also wondering about a non .NET
I have read this post about how to test private methods. I usually do
Reading this blog post about HttpOnly cookies made me start thinking, is it possible
I've stumbled across this great post about validating parameters in C#, and now I
While browsing I came across this blog post about using the Wikipedia API from
On this post , I read about the usage of XMPP. Is this sort

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.