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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:04:14+00:00 2026-06-15T23:04:14+00:00

I have a simple console application in visual studio for testing some code before

  • 0

I have a simple console application in visual studio for testing some code before going big.
But now i have a problem with parsing some string to double.

When the users input is a String: 0.10 i want to convert this to a double.
So the output should be a double: 0.10.

But when i do this with the following code:

double r_value = 0;
r_value = Math.Round(double.Parse(value), 2);

Or

r_value = double.Parse(value);

The output will be: 10 or 10.0.
How can it be this output changes like this? and converts to 10.0 instead 0.10 as i thought it should be.

  • 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-15T23:04:15+00:00Added an answer on June 15, 2026 at 11:04 pm

    I strongly suspect your default culture is one in which . is a grouping separator (usually for thousands). So where an English person might write ten thousand as “10,000” some other cultures would write “10.000”. At that point, your output makes sense.

    If you want to parse with the invariant culture (which treats . as a decimal separator and , as the grouping separator) do so explicitly:

    double r_value = double.Parse(value, CultureInfo.InvariantCulture);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a simple .EXE console application, written in C# via Visual Studio 2008.
I have simple C# console application developed in Visual Studio 2008, which writes information
I am new to visual studio.I have created a simple console application and then
I have written very very simple console application which supports some command line options.
I have a simple Console Project in Visual Studio that I want to run
I think this is simple, but not for me obviously! I have a console-application.
I have installed visual studio 2008 and i want to create some simple applications
i have created a very simple console application in vb.net that emails me some
I have a simple C# Console application in which I use FileSystemWatcher and Moving
I have a simple test application (C# console application) that does an HTTP GET

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.