In C# I have an integer value which need to be convereted to string but it needs to add zeros before:
For Example:
int i = 1;
When
To pad int i to match the string length of int x, when both can be negative:
int i
int x
i.ToString().PadLeft((int)Math.Log10(Math.Abs(x < 0 ? x * 10 : x)) + 1, '0')