You are on page 1of 1

=================================================================================

Getting Number of Digits in a number


=================================================================================
int digits = n == 0 ? 1 : Math.Floor(Math.Log10(Math.Abs(n)) + 1)

You might also like