[點晴永久免費OA]asp下返回以千分位顯示數字格式化的數值
當前位置:點晴教程→點晴OA辦公管理信息系統
→『 經驗分享&問題答疑 』
<%
'****************************** '函數: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 %> 該文章在 2022/6/22 0:40:14 編輯過 |
關鍵字查詢
相關文章
正在查詢... |