I have a float number such as x=23392342.1
x=23392342.1
I would like to convert it to a string with engineering notation (with metric prefix)
http://en.wikip
You can use Prefixed which has a float type with additional formatting options.
>>> from prefixed import Float >>> x = Float(23392342.1) >>> print(f'{x:!h}') 23.392342 M
Or if you want to keep 7 decimal places
>>> print(f'{x:!.7h}') 23.3923421 M