Tag Archives: custom numeric formats

Use custom numeric formats in C#

You can use formatting characters to display custom numeric formats for numeric values. These formats work with a variable’s ToString method as well as with string.Format. For example, the code (1.234).ToString(“0.00″) returns the value “1.23.” This example builds a ListView … Continue reading

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

Use custom date and time formats in C#

Note that custom date and time formats may not produce the result you want when you program runs in different locales. For example, the date January 23, 2010 should be displayed as 1/23/2010 in the United States but in as … Continue reading

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