public static void ConvertToArrayOfDigits(int value, int[] digits)
{ for (int index = digits.Length - 1; index >= 0; index--)
{ digits[index] = value % 10;
value = value / 10;
} }