More general numeric formatting $w.d$g

If you are happy letting Python choose between fixed format and scientific notation, then use $w.d$g.

These are the most commonly used format codes. There are many other options, which you can find in the course references.