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

Returns number as is.

Currency

Same as user defined number format "$#,##0.00;($#,##0.00)"

Not locale dependent at this time.

Fixed

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

Returns "No" if zero, else returns "Yes".

True/False

Returns "True" if zero, else returns "False".

On/Off

Returns "On" if zero, else returns "Off".

 

Example:


Sub Main
  Debug.Print Format$(2.145,"Standard") ' 2.15
End
Sub