Format a String to Currency in C# | Delft Stack
www.delftstack.com › howto › csharpMar 27, 2021 · We used the format specifier {0:C} to format the money in a currency formatted string. Format a String to Currency With the ToString() Method in C. The ToString() method is used to convert any data type to a string variable in C#. We can use the C string format specifier to format the resultant string variable in currency format. The following code example shows us how to format a string to currency format with the ToString() method in C#.
c# - String format currency - Stack Overflow
stackoverflow.com › questions › 10416553decimal value = 0.00M; value = Convert.ToDecimal(12345.12345); Console.WriteLine(".ToString(\"C\") Formates With Currency $ Sign"); Console.WriteLine(value.ToString("C")); //OutPut : $12345.12 Console.WriteLine(value.ToString("C1")); //OutPut : $12345.1 Console.WriteLine(value.ToString("C2")); //OutPut : $12345.12 Console.WriteLine(value.ToString("C3")); //OutPut : $12345.123 Console.WriteLine(value.ToString("C4")); //OutPut : $12345.1234 Console.WriteLine(value.ToString("C5")); //OutPut ...