国产探花免费观看_亚洲丰满少妇自慰呻吟_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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阜新市| 黄陵县| 华池县| 仪征市| 宁陕县| 淮阳县| 六盘水市| 泊头市| 东乡族自治县| 冀州市| 高密市| 永定县| 会同县| 章丘市| 苏尼特右旗| 汉沽区| 天等县| 岳西县| 霍州市| 长白| 工布江达县| 长垣县| 三明市| 乌拉特后旗| 曲阳县| 合山市| 双流县| 兴山县| 靖边县| 英吉沙县| 张家港市| 金乡县| 新源县| 元谋县| 简阳市| 通榆县| 湖口县| 凉城县| 石家庄市| 平定县| 邢台市|