无为清净楼资源网 Design By www.qnjia.com
<%
'******************************
'函数: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 
%>
标签:
asp下返回以千分位显示数字格式化的数值

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com

更新日志

2024年09月20日