- Home
·
- Math/Dates
·
- 'Formats a number into segments, e.g. 123456789 to 123'456'789
'Formats a number into segments, e.g. 123456789 to 123'456'789
'Formats a number into segments, e.g. 123456789 to 123'456'789
API Declarations
'only does upto 9 characters long but can easily be updated
Rate 'Formats a number into segments, e.g. 123456789 to 123'456'789
(2(2 Vote))
On Error Resume Next
Dim a As String, b As String, c As String, _
strin As String, d As String
strin = Str(itsin)
If Len(itsin) <= 3 Then
commentit = Str(itsin)
Exit Function
End If
If Len(itsin) <= 6 Then
a = Mid(strin, Len(strin) - 3, 3)
b = Mid(strin, 1, Len(strin) - 3)
c = b & "'" & a
commentit = c
Exit Function
End If
If Len(itsin) <= 9 Then
a = Mid(strin, Len(strin) - 3, 3)
b = Mid(strin, Len(strin) - 6, 3)
d = Mid(strin, 1, Len(strin) - 6)
c = d & "'" & b & "'" & a
commentit = c
Exit Function
End If
End Function
'Formats a number into segments, e.g. 123456789 to 123'456'789 Comments
No comments yet — be the first to post one!
Post a Comment