Tag Archives: standard formats

Use standard numeric formats in C#

You can use numeric formatting characters to display numbers in particular formats. These formats work with a variable’s ToString method as well as with String.Format. For example, the code value.ToString(“C”) returns the variable value formatted as currency. These formats are … Continue reading

Posted in formatting, strings | Tagged , , , , , , , , , , , , | Leave a comment

Use standard date and time formats in C#

You can use formatting characters to display date and time values in particular formats. These formats work with a variable’s ToString method as well as with String.Format. For example, the code DateTime.Now.ToString(“f”) returns the current date and time in full … Continue reading

Posted in formatting, strings | Tagged , , , , , , , , , , , , , , | 1 Comment

Use the DateTime class’s standard formatting methods in C#

The ToString and string.Format methods let you use formatting characters to format a DateTime value, but it’s not easy to remember all of the characters you might want to use. To make using standard formats easier, the DateTime class provides … Continue reading

Posted in formatting, strings | Tagged , , , , , , , , , , , , , , , | Leave a comment