I want to show some financial information such as Market Cap in a short version (x Mil/k).
I would need to recognise whether a number that I get from an API is in millions, thousands or hundreds and then show Mil, k or nothing instead.
So if it’s for example 234000000 I would need to make it look like this: 234 Mil - if it’s 832000.56 I would need to transform it into 832 k.
Does anybody know if it is possible and how to do it?
Thank you for the help!