VBScript FormatCurrency ຫຼັກສາບັນດາຄຳຖາມ
ການກໍານົດແລະການນໍາໃຊ້
FormatCurrency ຫຼັກສາບັນດາຄຳຖາມທີ່ຖືກຕັດສິນໃຫ້ເປັນມູນຄ່າເງິນຫຼັງຈາກການກຳນົດມູນຄ່າເງິນໃນຕາປະກອບຄວບຄຸມຂອງລະບົບ
ພາສາ
FormatCurrency(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 for decimal values (leading zero):
|
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
document.write(FormatCurrency(20000))
Output:
¥20,000.00
Example 2
document.write(FormatCurrency(20000.578,2))
Output:
¥20,000.58
Example 3
document.write(FormatCurrency(20000.578,2,,,0))
Output:
¥20000.58