I am looking at cryptocurrencies prices. When converted into bitcoin or sometimes even in usd, I get very small amount from the api I use.
This is the type of response I can get:
- 7.2e-05
- 4.89686e-07
Here is what I do:
answer_from_api = 7.2e-05
formatting = format(answer_from_api, "f")
print(formatting)
>>>> 0.000072
However, I would like to have a separator to get something easier to read, like so:
price = 0.000 072
And I would like it to work for very small numbers like this one: 4.89686e-07 but also not "break" higher number like 150.22
Any ideas? Best,