/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package UsefulCodes;

/**
 *
 * @author Marcos
 */
public class Count {
 private static int contaDigitos(int x) {
        int digitos = 0;
        while (x > 0) {   
            x /= 10;            
            digitos++;
        }
        return digitos;
    }
}

@@ -264,18 +264,21 @@
 nt %7B
-%0D%0A private
+    %0D%0A public
  sta
@@ -320,145 +320,37 @@
     
-int digitos = 0;%0D%0A        while (x %3E 0) %7B   %0D%0A            x /= 10;            %0D%0A            digitos++;%0D%0A        %7D%0D%0A        return digitos
+return (int)Math.log10(x) + 1
 ;%0D%0A 

update contaDigitos()