[Solved] Force an Integer To Be At Least 2 Digits Long [closed]


In any language (at least the ones i know) and integer value type will never have 2 digits length in any value below 10.

To display it with always a two digits length (as 02, 05, 12) you must convert your number to String and then padding it with 0.

Or you will evaluate it like:

String newValue = String.Format("{0:00}", yourInt);

As you see you will have to convert it to string before displaying it…

2

solved Force an Integer To Be At Least 2 Digits Long [closed]