asp下返回以千分位顯示數(shù)字格式化的數(shù)值
更新時(shí)間:2007年08月08日 11:42:09 作者:
<%
'******************************
'函數(shù):comma(str)
'參數(shù):str,待處理的數(shù)字
'作者:阿里西西
'日期:2007/7/12
'描述:返回以千分位顯示數(shù)字格式化的數(shù)值
'示例:<%=comma("120300")%>
'******************************
function comma(str)
if not(isnumeric(str)) or str = 0 then
result = 0
elseif len(fix(str)) < 4 then
result = str
else
pos = instr(1,str,".")
if pos > 0 then
dec = mid(str,pos)
end if
res = strreverse(fix(str))
loopcount = 1
while loopcount <= len(res)
tempresult = tempresult + mid(res,loopcount,3)
loopcount = loopcount + 3
if loopcount <= len(res) then
tempresult = tempresult + ","
end if
wend
result = strreverse(tempresult) + dec
end if
comma = result
end function
%>
'******************************
'函數(shù):comma(str)
'參數(shù):str,待處理的數(shù)字
'作者:阿里西西
'日期:2007/7/12
'描述:返回以千分位顯示數(shù)字格式化的數(shù)值
'示例:<%=comma("120300")%>
'******************************
function comma(str)
if not(isnumeric(str)) or str = 0 then
result = 0
elseif len(fix(str)) < 4 then
result = str
else
pos = instr(1,str,".")
if pos > 0 then
dec = mid(str,pos)
end if
res = strreverse(fix(str))
loopcount = 1
while loopcount <= len(res)
tempresult = tempresult + mid(res,loopcount,3)
loopcount = loopcount + 3
if loopcount <= len(res) then
tempresult = tempresult + ","
end if
wend
result = strreverse(tempresult) + dec
end if
comma = result
end function
%>
相關(guān)文章
ASP + Serv-u 實(shí)現(xiàn)FTP的代碼
ASP + Serv-u 實(shí)現(xiàn)FTP的代碼...2006-10-10ASP下實(shí)現(xiàn)自動(dòng)采集程序及入庫(kù)的代碼
ASP下實(shí)現(xiàn)自動(dòng)采集程序及入庫(kù)的代碼...2007-03-03關(guān)于WPF?WriteableBitmap類直接操作像素點(diǎn)的問題
WPF是微軟新一代圖形系統(tǒng),運(yùn)行在.NET Framework 3.0及以上版本下,為用戶界面、2D/3D 圖形、文檔和媒體提供了統(tǒng)一的描述和操作方法,本文重點(diǎn)給大家介紹WPF?WriteableBitmap類直接操作像素點(diǎn)的問題,感興趣的朋友一起看看吧2022-01-01asp怎么獲取毫秒數(shù)實(shí)現(xiàn)代碼
得到17位的當(dāng)前時(shí)間如:20091210105237238=2009年12月10日10:52:37:238,接下來(lái)在獲取毫秒數(shù),感興趣的朋友可以參考下哈,希望可以幫助到你2013-04-04ASP正則表達(dá)式清除HTML指定標(biāo)簽的方法
這篇文章主要介紹了ASP正則表達(dá)式清除HTML指定標(biāo)簽的方法,告訴大家如何精準(zhǔn)的過(guò)濾掉某些特定的屬性標(biāo)簽和參數(shù),感興趣的小伙伴們可以參考一下2015-09-09