MsgBox FormatNumber$(&H7FFFFFFF, , , , vbTrue)
Note that results depend on locale settings: most VB functions are locale aware, thus you get results according to which country the computer is located at.
If you wish to force to have commas every X character, you have to do it by yourself.
MsgBox Comma(&H7FFFFFFF)Code:Public Function Comma(ByVal Expression As String, Optional ByVal Spacing As Byte = 3) As String Dim lngA As Long, lngLen As Long If (Len(Expression) > Spacing) And (Spacing > 0) Then lngLen = (Len(Expression) \ Spacing) + Len(Expression) + ((Len(Expression) Mod Spacing) = 0) Comma = String$(lngLen, ",") lngLen = lngLen - Spacing + 1 For lngA = 1 To Len(Expression) \ Spacing Mid$(Comma, lngLen, Spacing) = Mid$(Expression, Len(Expression) - (lngA * Spacing) + 1, Spacing) lngLen = lngLen - Spacing - 1 Next lngA lngLen = lngLen + Spacing - 1 If lngLen > 0 Then Mid$(Comma, 1, lngLen) = Left$(Expression, lngLen) End If Else Comma = Expression End If End Function




Reply With Quote