You can use -log10(1-p). On the "nines" it is exactly the number of nines you have:
$ python3
Python 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> def nines(num):
... return -math.log10(1-num)
...
>>> nines(.9)
1.0
>>> nines(.99)
1.9999999999999996
>>> nines(.999)
2.9999999999999996
(Modulo floating point issues of course.)Which then smoothly covers the entire space:
>>> nines(.9321)
1.1681302257194985
>>> nines(.2)
0.09691001300805639
But good luck getting that standardized.
I worked at a 4 1/2 nines (99.997) place and it was pretty standard to speak of half-nines at least (although on reflection, perhaps not everyone understood that 0.7 was 1/2 of 0.9 and thought 99.995 was "4 and a half nines") - we went from 3 nines in 2015 to 4 1/2 in 2025 (maybe slide back a little in 2026) - fun task but takes sustained high-level interest in reliability for a long time.