Asp: retain two decimal places: asp retains two decimal places
<% = Formatnumber (-6665.8999, 3,-1,-) %>
(6665.900)
In this example, all parameters of the Formatnumber () function are used:
The first parameter (-6665.8999) specifies the number to be formatted.
The second parameter (3) specifies the number of digits displayed after the decimal point.
The third parameter (-1) Specifies whether to display the leading zero.
The fourth parameter (-1) Specifies whether to use parentheses for negative numbers.
The last parameter (0) Specifies whether to display the separator.
FormatNumber(Expression[,NumDigAfterDec[, IncLeadingDig[,UseParForNegNum[,GroupDig]]]])
| Parameters |
Description |
| Expression |
Required. The expression to be formatted. |
| NumDigAfterDec |
The number of digits to the right of the decimal point. The default value is-1 (the computer's region settings are used ). |
| IncLeadingDig |
Optional. Determines whether to display the leading zero (leading zero) of a small value ):
- -2 = TristateUseDefault-use the settings in computer region settings.
- -1 = TristateTrue-True
- 0 = TristateFalse-False
|
| UseParForNegNum |
Optional. Indicates whether to place a negative value in parentheses.
- -2 = TristateUseDefault-use the settings in computer region settings.
- -1 = TristateTrue-True
- 0 = TristateFalse-False
|
| GroupDig |
Optional. Indicates whether to use the numeric grouping symbol specified in the computer region settings to group numbers.
- -2 = TristateUseDefault-use the settings in computer region settings.
- -1 = TristateTrue-True
- 0 = TristateFalse-False
|