FormatNumber - function of language VBScript

Returns an expression formatted as a number.
FormatNumber(Value As Variant, [DigitsAfterDecimal As Variant], [LeadingDigit As Variant], [ParensForNegative As Long], [GroupDigits As Long]) As String
s = FormatNumber(Value[, DigitsAfterDecimal[, LeadingDigit[, ParensForNegative[, GroupDigits]]]])
Value(Variant) Value to be formatted
DigitsAfterDecimal[optional] (Variant) Numeric value indicating how many places to the right of the decimal are shown. The preset value is -1, which indicates that the computer's regional settings are used.
LeadingDigit[optional] (Variant) Constant that indicates whether a leading zero is shown for decimal values
-1=vbTrue - show
0=vbFalse - hide
-2=vbUseDefault - use default computer setting
ParensForNegative[optional] (Long) Constant that indicates whether to place negative values within parentheses
-1=vbTrue - to place within parentheses
0=vbFalse - not to place within parentheses
-2=vbUseDefault - use default computer setting
GroupDigits[optional] (Long) Constant that indicates whether numbers are grouped using the group delimiter specified in the control panel
-1=vbTrue - grouped
0=vbFalse - not grouped
-2=vbUseDefault - use default computer setting

If one or more of the optional arguments are omitted, then the values for the omitted arguments are provided by the computer's regional settings.

All settings information comes from the Regional Settings Number tab.

Dim nAngle, nSecant, sNumber
nAngle = 1.3
nSecant = 1/Cos(nAngle)
sNumber = FormatNumber(nSecant,4) 'Format nSecant to 4 decimal places
PROMOTIC 8.3.21 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice