# Number of digits in different number systems?

I know a similar question was asked before, but I wanted to know if this can be extended to any number system by a generic formula.

For example, given a number X in number system A, how many digits would it have in number system B? I'm looking for a sort of universal formula in terms of X, A and B.

Thanks

-

As J. M. said in a comment to the question you ask, an integer $X$ has $\lfloor 1+\log_B X\rfloor$ base-$B$ digits. Going from base $A$ to base $B$ the number of digits is multiplied by $\frac{\log A}{\log B}$ but that is approximate due to the 1 and the floor function.