I need to convert crypto currencies which have different decimals only by using their integer representation.
Imagine the following use case in their smallest integer representation:
- XMR: $1e12$
- BTC: $1e8$ (satoshis)
- USD: $1e2$ (cents)
with the following conversion rates:
- XMR/BTC: $0.02845543$
- BTC/USD: $8435.38$
And I need to how the XMR/USD exchange rate by using integers only.
The only solution I came up requires a division and as such will result in using a float number.
Is there any formula to do this conversion using powers of ten ?