ASP inside the round function is said to be a single-minded rounding function, but the FormatNumber function can also achieve almost equivalent to rounding function, tested, formatnumber than round more accurate. The FormatNumber function is primarily used to format numbers, currencies, and percent data, such as converting 35569.5867 to 35569.59, so rounding it up is pretty good. Here's how to use the FormatNumber function.
FormatNumber (Expression [, Digit [, Leadingdigit [, Paren [, Groupdigit]]].
Parameter: expression is required.
Digit: Displays the number of digits to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.
Leadingdigit: Displays the number of digits to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.
Paren: Displays the number of digits to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.
Groupdigit: Displays the number of digits to the right of the decimal point. The default value is-1, which indicates that the computer's locale is being used.
FormatNumber Usage Examples:
1. Keep Two decimal places:
Output Result: 3.14
2. Keep 3 decimal places:
Output Result: 45.325
Post language: The round function says rounding seems to be different from what we usually say, our usual is: is greater than or equal to 5 of the value, less than 5 of the value of the shed. But the round function is more than 5 of the value, less than 5 of the value of the house, equal to 5 of the odd number into even homes, so always feel a bit inconsistent with the habit, so still use the FormatNumber function bar. S
Note : Please pay attention to the Triple tutorial channel for more wonderful tutorials,