How to convert long format prices (with lots of zeros) into FX?

In the validator setup steps or on the proposal page we can see a lot of values such as 6000000000000FX or 100000000000000000000000FX or 1000000000000000000.

What’s the best way to convert these into human-format FX (with a decimal point)?

1 Like

I’ve come up with this shell command (needs to be used without FX suffix):

% echo 100000000000000000000000 | rev | cut -c 19- | rev
100000

So basically we need to take off the last 18 digits. However it’ll only work for numbers above 1.

1 Like

Python command:

python -c 'print(float(100000000000000000000000)/10**18)'

Version without scientific notation:

python -c 'print("{:f}".format(float(100000000000000000000000)/10**18))'