Optimized an expensive call to strlen to a call to log10 (for computing the number of digits of an integer).