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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:55:41+00:00 2026-06-12T06:55:41+00:00

When I have such piece of code in C#: double a = 0.003; Console.WriteLine(a);

  • 0

When I have such piece of code in C#:

double a = 0.003;
Console.WriteLine(a);

It prints “0,003”.

If I have another piece of code:

double a = 0.003;
Console.WriteLine(a.ToString(CultureInfo.InvariantCulture));

It prints “0.003”.

My problem is that I need a dot as decimal mark but C# makes a comma as default. Besides I don’t want to type such a long line of code just for printing out a double variable.

  • 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-12T06:55:42+00:00Added an answer on June 12, 2026 at 6:55 am

    You can set the culture of the current thread to any culture you want:

    Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
    

    Note that changing the culture also affects things like string comparison and sorting, date formats and parsing of dates and numbers.

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

Sidebar

Related Questions

So here's the problem. I have a piece of code that when execute in
I have such html piece of code: <ul class=myClass> <li><a href=url1.html>first link</a></li> <li><a href=url2.html>second
If I have a piece of code such as this: private void DoOperations(//method passed
I have a piece of code that will take a string and repeat it
We have a requirement that every piece of code that makes it into production
I have such piece of code. I have 4 sets of checkboxes on a
I have a piece of code (.NET4 C#) that should run in tight loop
I'm facing an interesting problem here. I have a piece of code where I'd
I have such piece of code: string suffix = wallpapers\\; string extenstion = .jpg;
I have a simple piece of code that i want to use in my

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.