Let:
>>> num = 0.0012345
For up to 3 significant figures:
>>> f'{num:.3}'
'0.00123'
For 3 decimal places:
>>> f'{num:.3f}'
'0.001'
See the “presentation types for floating point and decimal” table at the bottom of this section for any additional requirements provided by e, E, f, F, g, G, n, %, None.