你说一个字符串,所以这可能帮助。这是一个从很长一段时间前,所以... :)
Dim IntPart, DecPart
''Format for this locale
cur = (Format(cur, "#,###.00"))
''This locale uses stop as decimal separator
''Change the "." to the decimal separator for your locale
If InStr(1, cur, ".") > 0 Then
DecPart = Mid(cur, InStr(1, cur, ".") + 1)
Else
DecPart = "00"
End If
''Ditto, change the stop.
IntPart = Mid(cur, 1, InStr(1, cur, ".") - 1)
''This locale uses comma for thousands separator,
''so change the "," to the thousands separator for your locale
''and ="." to the required replacement separator
Do While InStr(1, IntPart, ",") > 0
Mid(IntPart, InStr(1, IntPart, ","), 1) = "."
Loop
''This set the decimal separator to a comma,
''choose the separator required.
EUCurrency = IntPart & "," & DecPart
嗯,我认为更多有关像FormatSpecial(num,“##。##”,Culture:=“de”)'这样的形式更优雅(和简洁)的东西。但由于这似乎并不存在,我将使用'Replace(Format(CStr(n),“##。##”),“,”,“。”)''。我处理的数字都很小,所以我不需要关心千位分隔符。不过,谢谢你的努力。 – phg 2012-04-25 07:57:00