Numeric Formatting Sections


A numeric format specifier may contain one, two, or three sections separated by semicolons. If the specifier contains one section, the specifier is used for all numeric values.

If the specifier contains two sections, the first is used to format values that are positive or zero, and the second is used to format negative values.

If the specifier contains three sections, the first is used to format positive values, the second is used to format negative values, and the third is used to format values that are zero.

The following text shows output from the Immediate window for three values using the format specifier #,#.00;<#,#.00>;ZERO:

  ?(1234.5678).ToString("#,#.00;<#,#.00>;ZERO") 1,234.57 ?(-1234.5678).ToString("#,#.00;<#,#.00>;ZERO") <1,234.57> ?(0).ToString("#,#.00;<#,#.00>;ZERO") ZERO 




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net