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

源码网商城

ASP把长的数字用逗号隔开显示的代码

  • 时间:2020-12-14 05:13 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ASP把长的数字用逗号隔开显示的代码
000000000000000000000000000000000000000000000000000000000000000
[u]复制代码[/u] 代码如下:
<%  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  %>  <html>  <body>  <%  aLongNumber = "12345678"  %>  An un-formatted number: <%=aLongNumber%><br>  The Comma formatted number: <%=Comma(aLongNumber)%>  </body>  </html>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部