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

首頁 > 編程 > ASP > 正文

asp下返回以千分位顯示數字格式化的數值

2024-05-04 11:01:26
字體:
來源:轉載
供稿:網友
<%
'******************************
'函數:comma(str)
'參數:str,待處理的數字
'作者:阿里西西
'日期:2007/7/12
'描述:返回以千分位顯示數字格式化的數值
'示例:<%=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 
%>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 车致| 准格尔旗| 右玉县| 绥中县| 化州市| 广昌县| 平南县| 浦城县| 建平县| 太原市| 闵行区| 宿松县| 长汀县| 离岛区| 古浪县| 霍山县| 五常市| 旬阳县| 夏津县| 固阳县| 墨脱县| 鄂伦春自治旗| 唐河县| 措美县| 武宁县| 恩施市| 繁昌县| 海盐县| 邹城市| 平塘县| 镇康县| 拉萨市| 荥阳市| 嵊州市| 台湾省| 大连市| 正定县| 库伦旗| 广宗县| 正定县| 岳池县|