# Precision in bits

how do you convert precision in bits to number of decimal digits ? I couldn't find out the formula. googling didn't help either. What I'm asking is;

print(N(pi, prec=2)) gives 3.0

print(N(pi, prec=4)) gives 3.2

print(N(pi, prec=6)) gives 3.1

print(N(pi, prec=12)) gives 3.14

etc.