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. The output was generated using the ToString method and the English-United States (en-US) culture. | |||
Format string | Data type | Value | Output |
##### | Double | 123 | 123 |
00000 | Double | 123 | 00123 |
(###) ### - #### | Double | 1234567890 | (123) 456 – 7890 |
#.## | Double | 1.2 | 1.2 |
0.00 | Double | 1.2 | 1.20 |
00.00 | Double | 1.2 | 01.20 |
#,# | Double | 1234567890 | 1,234,567,890 |
#,, | Double | 1234567890 | 1235 |
#,,, | Double | 1234567890 | 1 |
#,##0,, | Double | 1234567890 | 1,235 |
#0.##% | Double | 0.086 | 8.6% |
0.###E+0 | Double | 86000 | 8.6E+4 |
0.###E+000 | Double | 86000 | 8.6E+004 |
0.###E-000 | Double | 86000 | 8.6E004 |
[##-##-##] | Double | 123456 | [12-34-56] |
##;(##) | Double | 1234 | 1234 |
##;(##) | Double | -1234 | (1234) |
Friday, April 2, 2010
Labels:
asp.net,
C#,
string format
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment