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

首頁(yè) > 編程 > ASP > 正文

ASP把長(zhǎng)的數(shù)字用逗號(hào)隔開(kāi)顯示的代碼

2024-05-04 10:57:26
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
000000000000000000000000000000000000000000000000000000000000000
復(fù)制代碼 代碼如下:

<% 
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>
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 浦江县| 翁牛特旗| 河西区| 曲松县| 玛多县| 元氏县| 泉州市| 南皮县| 长泰县| 吉首市| 邢台市| 保靖县| 顺平县| 凤翔县| 博罗县| 达日县| 泸定县| 嘉义市| 铁岭县| 巴林左旗| 镇远县| 获嘉县| 新化县| 靖安县| 依安县| 乌拉特前旗| 孙吴县| 马关县| 射阳县| 合作市| 延安市| 泰来县| 永城市| 丁青县| 丹东市| 金门县| 沙雅县| 额敏县| 潼关县| 巫山县| 祁门县|