by Deano Splamoni (15 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 31st July 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
'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
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