ASP to the long number of comma-separated display code _ Application Tips

Source: Internet
Author: User
000000000000000000000000000000000000000000000000000000000000000
Copy Code code as follows:

<%
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
%>
<body>
<%
Alongnumber = "12345678"
%>
An un-formatted number: <%=aLongNumber%><br>
The Comma formatted number: <%=comma (alongnumber)%>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.