I am trying to convert an int to a three character string. I need to convert 1 into "001."
The built in INT() and CHAR() functions do not work.
I have created a workaround by using switch statements which works in the short term but is not an elegant solution.
Code:
Function Int_to_Char(temp As Integer) As String
Select Case temp
Case 1
Int_to_Char = "001"
Case 2
Int_to_Char = "002"
Case 3
Int_to_Char = "003"
...
And:
Code:
Function Char_to_Int(temp As String) As Integer
Select Case temp
Case "001"
Char_to_Int = 1
Case "002"
Char_to_Int = 2
Case "003"
...
Can anyone show me a quick way to do the above conversion?