源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

asp下返回以千分位显示数字格式化的数值

  • 时间:2022-11-01 04:51 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:asp下返回以千分位显示数字格式化的数值
<% '****************************** '函数: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  %>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部