ASP to return the value of the format of the number in thousand-digit _ application Tips
Source: Internet
Author: User
<%
'******************************
' Function: comma (str)
' parameter: STR, number to be processed
' Author: Arisisi
' Date: 2007/7/12
' Description: Returns the number formatted with thousands of digits
' Example: <%=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
%>
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