Skip to content

Instantly share code, notes, and snippets.

@yohey03518
Created June 12, 2022 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yohey03518/84157505e6d89aa2203213a1353f1f79 to your computer and use it in GitHub Desktop.
Save yohey03518/84157505e6d89aa2203213a1353f1f79 to your computer and use it in GitHub Desktop.
float num_float = 12345.00f;
double num_double = 12345.00;
decimal num_decimal = 12345.00m;
Console.WriteLine("Current Culture (default) : " + Thread.CurrentThread.CurrentCulture.Name);
Console.WriteLine("num_float.ToString(\"F\"): " + num_float.ToString("F"));
Console.WriteLine("num_double.ToString(\"F\"): " + num_double.ToString("F"));
Console.WriteLine("num_decimal.ToString(\"F\"): " + num_decimal.ToString("F"));
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
Console.WriteLine("Current Culture: " + Thread.CurrentThread.CurrentCulture.Name);
Console.WriteLine("num_float.ToString(\"F\"): " + num_float.ToString("F"));
Console.WriteLine("num_double.ToString(\"F\"): " + num_double.ToString("F"));
Console.WriteLine("num_decimal.ToString(\"F\"): " + num_decimal.ToString("F"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment