Submitted by: Srinath M S(srinath_ms@yahoo.com)

Friday Aug 16th 2019 by Srinath M S
Article Image

Language: .NET, Expertise: Intermediate - See how to use the CultureInfo class in C# to format values based on a culture.

Use the CultureInfo class to format values based on a culture. See below for an example:

public static void Main()
      decimal inputValue = 233;
      CultureInfo currentCulture = new CultureInfo("en-US"); 
      string formattedString = string.Format(currentCulture, "{0:C}", inputValue);

Mobile Site | Full Site