国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp下返回以千分位顯示數字格式化的數值

2024-05-04 11:01:26
字體:
來源:轉載
供稿:網友
<%
'******************************
'函數:comma(str)
'參數:str,待處理的數字
'作者:阿里西西
'日期:2007/7/12
'描述:返回以千分位顯示數字格式化的數值
'示例:<%=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 
%>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 义乌市| 蒲江县| 铜陵市| 邵武市| 惠东县| 中阳县| 阜新市| 华池县| 浙江省| 淮滨县| 罗江县| 始兴县| 桃园市| 澎湖县| 剑河县| 资兴市| 济阳县| 德兴市| 巩留县| 郧西县| 长宁县| 呼和浩特市| 揭西县| 社会| 德化县| 乐都县| 五常市| 白山市| 抚远县| 图木舒克市| 宣恩县| 盐亭县| 彭山县| 抚顺县| 云和县| 衡阳县| 江津市| 松潘县| 含山县| 太白县| 广宗县|