#32004/2/5 14:41:18
先谢过2楼的朋友!!!!!
经测试可以实现。算法是正确的。
:D
我的一个朋友给我这样做的,可以实现我的要求,贴在这里也许别的朋友能用上,
-------------------------------------------------------------------------
Function wwqformat(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
wwqformat = Result
End Function
--------------------------------------------------------------------