VBScript FormatNumber Function
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။
FormatNumber လုပ်ဆောင်ချက်သည် နံပါတ်တစ်ခုအဖြစ် ဖော်မတ်လုပ်ထားသည့် စကားရပ်ကို ပြန်ပေးသည်။
အထားအသို
FormatNumber(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:
|
ဥပမာများ
ဥပမာ ၁
<%
response.write(FormatNumber(20000))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
20,000.00
ဥပမာ ၂
ဒဿမ အရေအတွက် သတ်မှတ်ခြင်း-
<%
response.write(FormatNumber(20000,2) & "<br />")
response.write(FormatNumber(20000,5))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
20,000.00
20,000.00000
ဥပမာ ၃
သုည ဦးဆောင်သည့် သို့မဟုတ် မရှိသော အပိုင်းကိန်းတန်ဖိုးများ-
<%
response.write(FormatNumber(.20,,0) & "<br />")
response.write(FormatNumber(.20,,-1))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
.20
0.20
ဥပမာ ၄
ကွင်းအတွင်းရှိ အနုတ်လက္ခဏာတန်ဖိုးများ ရှိသည်ဖြစ်စေ မရှိသည်-
<%
response.write(FormatNumber(-50,,,0) & "<br />")
response.write(FormatNumber(-50,,,-1))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
-50.00
(50.00)
ဥပမာ ၅
နံပါတ်များ အုပ်စုဖွဲ့ခြင်း - သို့မဟုတ် မပါ
<%
response.write(FormatNumber(1000000,,,,0) & "<br />")
response.write(FormatNumber(1000000,,,,-1))
%>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
1000000.00
1,000,000.00
❮ VBScript အကိုးအကားကို အပြီးသတ်ပါ။