国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ASP把長的數字用逗號隔開顯示的代碼

2024-05-04 11:00:43
字體:
來源:轉載
供稿:網友
000000000000000000000000000000000000000000000000000000000000000
復制代碼 代碼如下:
<% 
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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 浮梁县| 区。| 越西县| 奉贤区| 年辖:市辖区| 四子王旗| 吉林市| 凤凰县| 鄂托克前旗| 云安县| 武汉市| 连平县| 聂拉木县| 酉阳| 峨山| 卓资县| 会泽县| 桓台县| 六枝特区| 临泽县| 四子王旗| 六枝特区| 宜阳县| 宣恩县| 涿鹿县| 武城县| 堆龙德庆县| 中江县| 河曲县| 开江县| 和田县| 沁水县| 桦南县| 门头沟区| 大余县| 渭南市| 天长市| 临沧市| 任丘市| 成安县| 页游|