Is there a way to format an integer to be at least X digits by adding trailing zeroes? Such that with X being 4 I would get:
4 -> 4000
58 -> 5800
372 -> 3720
5432 -> 5432
12345678 -> 12345678
I know how to write a helper function to achieve this, just wondering if there is a built-in string formatting method to do the same.
>Solution :
int intValue = 20;
int x=4;
int.parse(intValue.ToString().PadRight('0',x))
Something like this should work
Check the syntax.