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