FormatNumber() |
Top Previous Next |
FormatNumber() - Formats a Number Description The FormatNumber() function takes a number or expression and returns a formatted number based on the parameters. FormatNumber(Number[,Precision [,IncludeLeadingZero [,UseParensForNegatives [,GroupDigits]]]]) Returned formatted string Parameters The optional Precision parameter specifies the the number of decimal points to display. The optional IncludeLeadingZero parameter specifies whether fractions should be shown with a leading 0 before the decimal place. The possible values can be found in [id=52]this table[/id]. The optional UseParensForNegatives parameter specifies whether negative values should be shown within parentheses. The possible values can be found in [id=52]this table[/id]. The optional GroupDigits parameter specifies whether numbers should use the group delimiter specified in the computer's regional settings. The possible values can be found in [id=52]this table[/id]. Example MyAmount = FormatNumber(15*30) 'contains 450.00
MyAmount = FormatNumber(-54/7,1,,-1) 'contains (7.7) |