<%
'*******************************
'機能:コンマ(str)
'パラメーター:STR、処理する番号
著者:アリクシ
'日付:2007/7/12
'説明:1000分の1の数値の表示でフォーマットされた値を返します
'例:<%= comma( "120300")%>
'*******************************
functioncomma(str)
ifnot(isnumeric(str))orstr = 0then
結果= 0
elseiflen(fix(str))<4then
結果= str
それ以外
pos = strust(1、str、 "。")
IFPOS> 0 -then
dec = mid(str、pos)
endif
res = strreverse(fix(str))
loopcount = 1
WhileLoopCount <= len(res)
tempresult = tempresult+mid(res、loopcount、3)
loopcount = loopcount+3
ifloopcount <= len(res)then
tempresult = tempresult+"、"
endif
ウェンド
result = strreverse(tempresult)+dec
endif
コンマ=結果
エンド機能
%>