Figure 6


(a) Declaration for the Round function; (b) functions to format strings, numbers, and dates.

(a)

Function Round(ByVal Expression As Variant, 
Optional ByVal NumDecimalPlaces As Long = 2) As Variant

(b) 

Function FormatNumber(ByVal Expression As Variant,
Optional ByVal NumDigitsAfterDecimal As Long = -1,
Optional ByVal IncludeLeadingDigit As vbTristate = vbUseDefault,
Optional ByVal UseParensForNegativeNumbers As vbTristate = vbUseDefault,
Optional ByVal GroupDigits As vbTristate = vbUseDefault) As String

Function FormatCurrency(ByVal Expression As Variant,
Optional ByVal NumDigitsAfterDecimal As Long = -1,
Optional ByVal IncludeLeadingDigit As vbTristate = vbUseDefault,
Optional ByVal UseParensForNegativeNumbers As vbTristate = vbUseDefault,
Optional ByVal GroupDigits As vbTristate = vbUseDefault) As String

Function FormatPercent(ByVal Expression As Variant, 
Optional ByVal NumDigitsAfterDecimal As Long = -1,
Optional ByVal IncludeLeadingDigit As vbTristate = vbUseDefault,
Optional ByVal UseParensForNegativeNumbers As vbTristate = vbUseDefault,
Optional ByVal GroupDigits As vbTristate = vbUseDefault) As String

Function FormatDateTime(ByVal Date As Date, 
Optional ByVal NamedFormat As vbDateTimeFormat = vbGeneral) As String