How can I get a count of the total number of digits in a number?

Without converting to a string you could try

Math.Floor(Math.Log10(n) + 1);

Leave a Comment