I have do detect the amount of digits on a number. For example, 329586
has 6
digits.
What I done, is simply parsing the number to string, and getting the string length, like:
number.toString().length()
But, is there a fastest way to count digits on a number? I have to use this method several times, so I think using toString()
can impact performance.
Thanks.