Asp reserved integer 0
FormatNumber function

See.

Format Currency Function Format Date Time Function Format Percentage Function

ask

Version 2

Returns an expression formatted as a numeric value.

Format number (

Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]

)

argue

express

Required option. The expression to format.

NumDigitsAfterDecimal

Optional. A numeric value indicating the number of digits displayed to the right of the decimal point. The default value is-1, which means the regional settings of the computer are used.

Include numbers.

Optional. Tri-state constant indicating whether to display zero before decimal point of decimal value. For numerical values, see the Settings section.

UseParensForNegativeNumbers

Optional. Tri-state constant indicating whether to put negative values in parentheses. For numerical values, see the Settings section.

GroupDigits

Optional. Tri-state constant, indicating whether the numbers are grouped by using the number grouping symbol specified in the computer regional settings. For numerical values, see the Settings section.

build

IncludeLeadingDigit, UseParensForNegativeNumbers, and GroupDigits parameters can have the following values:

Constant value description

tristat True- 1 True

Three-state false zero false

Tristeusedefault-2 uses the settings in the computer regional settings.

explain

When one or more optional parameters are omitted, the values of the omitted parameters are provided by the computer regional settings.

Please note that all setting information comes from the Numbers tab of the regional settings.

The following example uses the FormatNumber function to format a number with four decimal places:

Function format digital demonstration

Dim MyAngle,MySecant,MyNumber

MyAngle = 1.3' defines the angle in radians.

Myscan =1/cos (myangle)' to calculate the secant value.

Format number demo = format number (my scant, 4)' Format myscant as a number with four decimal places.

End function

& lt%

Meager salary

Payment =0.5

response.write FormatNumber(Pay, 1,- 1)

% & gt

Display result: 0.5

FormatNumber(Pay, showing digits after decimal point and leading 0)