Format Predefined Number
Description
The following predefined number formats may be used with the Format function. Predefined formats may not be combined with user defined formats or other predefined formats.
Form |
Description |
General Number |
Return number as is. |
Currency |
Same as user defined number format "$#,##0.00;($#,##0.00)" |
Fixed |
Same as user defined number format "0.00". |
Standard |
Same as user defined number format "#,##0.00". |
Percent |
Same as user defined number format "0.00%". |
Scientific |
Same as user defined number format "0.00E+00". |
Yes/No |
Return "No" if zero, else return "Yes". |
True/False |
Return "True" if zero, else return "False". |
On/Off |
Return "On" if zero, else return "Off". |
Example
Sub Main
Debug.Print Format$(2.145,"Standard") ' 2.15
End Sub