FormatPercent() |
Top Previous Next |
FormatPercent() - Formats a Number as a Percentage Description The FormatPercent() function takes a number or expression and returns a formatted percentage value with a trailing % character. FormatPercent(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 = FormatPercent(75/100,0) 'contains 75%
MyAmount = FormatPercent(-0.54/7,1,,-1) 'contains (7.7%) |