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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:53:40+00:00 2026-06-03T13:53:40+00:00

I have a line like the following in my code: string buffer = string.Format(CultureInfo.InvariantCulture,

  • 0

I have a line like the following in my code:

string buffer = string.Format(CultureInfo.InvariantCulture, "{0:N4}", 1008.0);

Why does buffer contain 1,008.0 (note comma) after executing this line?

Yes, I do guess that it’s caused by my regional settings. The question is why they affect the result in this case?

EDIT:

Ok, I understand that it’s completely my fault. It seems like I should have used F format specifier.

  • 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-03T13:53:41+00:00Added an answer on June 3, 2026 at 1:53 pm

    The InvariantCulture is loosely based on en-US which uses , as a thousands (group) separator.

    Your result is what I would expect.

    I also point you to the details of the N numeric format specifier:

    The numeric (“N”) format specifier converts a number to a string of the form “-d,ddd,ddd.ddd…”, where “-” indicates a negative number symbol if required, “d” indicates a digit (0-9), “,” indicates a group separator, and “.” indicates a decimal point symbol.

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

Sidebar

Related Questions

Suppose I have a line of code that starts like the following: Func1(Func2(Func3 Is
I have a string line like the following : A:B:C:D:E:F:G:H:I:J:K:L:M It means delimiter (
I have to write a code in JAVA like following structure: Read String From
I have a 3-tuple list like the following [I added line breaks for readability]:
I have the following line of jQuery but it seems like overkill to use
I use SmartGwt and I have the following line: formItem.getForm().getField(report_date).getValue().toString(); This returns something like
I have a file that might contain a line like this. A B //Seperated
Right now I have the following code: String[] values = {str1, str2}; Utils.myMethod(values); I
See i have this following code below, at line no.9 i'm calculating some dates
So in C# to use a stored procedure I have code like the following

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.