فونکشن FormatPercent دا VBScript
تعریف و استفاده
FormatPercent فونکشن بزائی دا کا عبارت دا فورمات کری وایا کا فیصد (دوایرہ وایا کا فیصد (100 کا کری وایا )) دا فیصد وایا کری وایا دا کا فورمات کری وایا آتا % وایا دا کا فیصد وایا آتا
语法
FormatPercent(Expression[,NumDigAfterDec[, IncLeadingDig[,UseParForNegNum[,GroupDig]]]]
Parameter | Description |
---|---|
expression | Required. The expression to be formatted. |
NumDigAfterDec | Indicates the number of digits to display to the right of the decimal point. The default value is -1 (using the computer's regional settings). |
IncLeadingDig | Optional. Indicates whether to display leading zeros (leading zero) for decimal values:
|
UseParForNegNum | Optional. Indicates whether to place negative values in parentheses.
|
GroupDig | Optional. Indicates whether to use the number grouping symbol specified in the computer's regional settings to group numbers.
|
Instance
Example 1
'6 is what percentage of 345? document.write(FormatPercent(6/345))
Output:
1.74%
Example 2
'6 is what percentage of 345? document.write(FormatPercent(6/345,1))
Output:
1.7%