This documentation is archived and is not being maintained.

Custom Numeric Format Strings Output Examples

The following table illustrates the output created by applying some custom numeric format strings to specific data types and values. Output was generated using the ToString method and the U.S. English culture.

The Format column indicates the format string, the Data type column indicates the data type used, the Value column indicates the value of the number being formatted, and the Output column indicates the result of formatting.

FormatData typeValueOutput
#####Double123123
00000Double12300123
(###) ### - ####Double1234567890(123) 456 – 7890
#.##Double1.21.2
0.00Double1.21.20
00.00Double1.201.20
#,#Double12345678901,234,567,890
#,,Double12345678901235
#,,,Double12345678901
#,##0,,Double12345678901,235
#0.##%Double0.0868.6%
0.###E+0Double860008.6E+4
0.###E+000Double860008.6E+004
0.###E-000Double860008.6E004
[##-##-##]Double123456[12-34-56]
##;(##)Double12341234
##;(##)Double-1234(1234)

See Also

Custom Numeric Format Strings | Standard Numeric Format Strings

Show: