SyntaxFix
Write A Post
Hire A Developer
Questions
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')