वीबीस्क्रिप्ट प्रारूप मुद्रा समारोह
❮ पूर्ण वीबीस्क्रिप्ट संदर्भ
FormatCurrency फ़ंक्शन कंप्यूटर के नियंत्रण कक्ष में परिभाषित मुद्रा प्रतीक का उपयोग करके मुद्रा मान के रूप में स्वरूपित एक अभिव्यक्ति देता है।
वाक्य - विन्यास
FormatCurrency(Expression[,NumDigAfterDec[,
IncLeadingDig[,UseParForNegNum[,GroupDig]]]])
Parameter | Description |
---|---|
expression | Required. The expression to be formatted |
NumDigAfterDec | Optional. Indicates how many places to the right of the decimal are displayed. Default is -1 (the computer's regional settings are used) |
IncLeadingDig | Optional. Indicates whether or not a leading zero is
displayed for fractional values:
|
UseParForNegNum | Optional. Indicates whether or not to place negative
values within parentheses:
|
GroupDig | Optional. Indicates whether or not numbers are grouped
using the group delimiter specified in the computer's regional settings:
|
उदाहरण
उदाहरण 1
<%
response.write(FormatCurrency(20000))
%>
उपरोक्त कोड का आउटपुट होगा:
$20,000.00
उदाहरण 2
दशमलव की संख्या निर्धारित करना:
<%
response.write(FormatCurrency(20000,2) & "<br />")
response.write(FormatCurrency(20000,5))
%>
उपरोक्त कोड का आउटपुट होगा:
$20,000.00
$20,000.00000
उदाहरण 3
एक अग्रणी शून्य के साथ या उसके बिना भिन्नात्मक मान:
<%
response.write(FormatCurrency(.20,,0) & "<br />")
response.write(FormatCurrency(.20,,-1))
%>
उपरोक्त कोड का आउटपुट होगा:
$.20
$0.20
उदाहरण 4
कोष्ठक के अंदर नकारात्मक मान या नहीं:
<%
response.write(FormatCurrency(-50,,,0) & "<br />")
response.write(FormatCurrency(-50,,,-1))
%>
उपरोक्त कोड का आउटपुट होगा:
-$50.00
($50.00)
उदाहरण 5
एक मिलियन डॉलर का समूह बनाना - या नहीं:
<%
response.write(FormatCurrency(1000000,,,,0) & "<br />")
response.write(FormatCurrency(1000000,,,,-1))
%>
उपरोक्त कोड का आउटपुट होगा:
$1000000.00
$1,000,000.00
❮ पूर्ण वीबीस्क्रिप्ट संदर्भ