Link to home
Start Free TrialLog in
Avatar of se402036se
se402036se

asked on

display an int with 1 or 2 digits as a 2 digit number?

If I have an integer with 1 or 2 digits e.g. 1 or 9 or 11 how can I display it as two digits?

i.e.
01, 09 and 11

There must be a function of something instead of inspecting the int and adding a '0' to the begining of it if it is only 1 digit long

Thanks
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZeonFlash
ZeonFlash

You can also try MyInteger.ToString.Padleft(2, "0")