-
-
'ฟังก์ชั่น: เครื่องหมายจุลภาค (STR)
'พารามิเตอร์: STR จำนวนที่จะประมวลผล
'ผู้แต่ง: Alixi
'วันที่: 2007/7/12
'คำอธิบาย: ส่งคืนค่าที่จัดรูปแบบในการแสดงตัวเลขตัวเลขในพัน
'ตัวอย่าง: <%= comma ("120300")%>
-
FunctionComma (STR)
ifnot (isnumeric (str)) orstr = 0 แล้ว
ผลลัพธ์ = 0
elseiflen (fix (str)) <4 จากนั้น
ผลลัพธ์ = Str
อื่น
pos = instr (1, str, ".")
ifpos> 0 แล้ว
ธ.ค. = กลาง (str, pos)
endif
res = strreverse (fix (str))
loopcount = 1
ในขณะที่ <= len (res)
tempresult = tempresult+mid (res, loopcount, 3)
loopcount = loopcount+3
ifloopcount <= len (res) จากนั้น
tempresult = tempresult+","
endif
ใช้
ผลลัพธ์ = strreverse (tempresult)+ธ.ค.
endif
เครื่องหมายจุลภาค = ผลลัพธ์
endfunction
-