I am trying to format an integer so that if it is one digit, it includes a leading zero, e.g. 1 becomes 01. The only way I have found to do it is by converting it to a string checking if the length is 1, then adding a 0 to the front.
Is there a better way or a different data type to use?
------------------------------------
There's no place like 127.0.0.1
------------------------------------
Is there a better way or a different data type to use?
------------------------------------
There's no place like 127.0.0.1
------------------------------------