Maximum base - 36 String base_num = " " ;
StringBuilder base_num = new StringBuilder ( ) ; while ( num > 0 ) { int dig = ( num % bases ) ; if ( dig < 10 ) base_num . append ( String . valueOf ( dig ) ) ; else base_num . append ( String . valueOf ( ( ' A ' + dig - 10 ) ) ) ; num /= bases ; }