Hi @copy_writes
If you are holding these numbers (12345678 AND 1234567) in a variable lets say Digits_count
Digits_count.ToString.Length will give the number of digits in the number and use IF condition to control the flow in the way it is required
Hope this is helpful