Nov 10

Print this Post

Pad Integer to Two Digits Function (twoDigit)

Formats an integer into a string that is at least 2 digits long. Useful for formatting dates in file names

function twoDigit(input)
	if len(input) = 1 then
		twoDigit = "0" & input
		twoDigit = input
	end if
end function

Permanent link to this article: https://www.wperry.net/code/twodigit/

Leave a Reply

Your email address will not be published. Required fields are marked *