.Net Framework various format string

Common C#.Net Format Strings List

Name Format String Example Comments
Currency Format C or c or (C2 or C3 - numeric digit signify precision)
Console.WriteLine(amount.ToString("C"))
output depends on your current UI culture
Percent Format P or p or (P1 or P2 - numeric digit signify precision)
Console.WriteLine(number.ToString("P"))
output depends on your current UI culture
Padding with leading zero Format 0
var input = "123"; Console.WriteLine(input.ToString("0000")); //result will be 0123
Replaces the zero placeholder with the corresponding digit if one is present; otherwise, zero appears in the result string.
Enumeration Format strings G or g
Console.WriteLine(LogLevel.Verbose.ToString("G"))); 
Displays enum entry as a string value. Here result will be Verbose
Enumeration Format strings G or g or F or f
Console.WriteLine(LogLevel.Verbose.ToString("G"))); 
Displays enum entry as a string value. Here result will be Verbose
Enumeration Format strings D or d
Console.WriteLine(LogLevel.Verbose.ToString("D"))); 
Displays enum entry as a integer value. Here result will be 1