user56847: I can't find a "cryptocurrency" stack exchange, and I have a question that spans all cryptocurrencies, in particular, how to handle them programatically - one database column to rule them "all"!
I say "all", because it's becoming super-hard to keep track of them all, so I don't expect anybody to know the whole story.
So, we want to store an amount in the database - the implication for BTC is that we should store values from 1e-8 to 1e8 - but what about other cryptocurrencies?
I'm looking for a value which would be enough for all of the current mainstream coins, and if possible (fingers crossed!) a rationale why that value would be enough for at least 90% of any future currencies that might appear?

user15715: I can't answer for all cryptocurrencies, but for bitcoin, you shoud store values as long and not doubles. The unit of account of bitcoin is the satoshi, a hundred millionth of Bitcoin. Since there can only be 21M BTC ever, that's a maximum of 2.1 quadrillion (2.1 * 10^5) satoshis. That number fits in 64 bits.
For Ethereum, you need 256 bits unsigned integers IIRC.

56847: <p>I can't find a "cryptocurrency" stack exchange, and I have a question that spans all cryptocurrencies, in particular, how to handle them programatically - one database column to rule them "all"!</p>

<p>I say "all", because it's becoming super-hard to keep track of them all, so I don't expect anybody to know the whole story.</p>

<p>So, we want to store an amount in the database - the implication for BTC is that we should store values from 1e-8 to 1e8 - but what about other cryptocurrencies?</p>

<p>I'm looking for a value which would be enough for all of the current mainstream coins, and if possible (fingers crossed!) a rationale why that value would be enough for at least 90% of any future currencies that might appear?</p>
 15715: <p>I can't answer for all cryptocurrencies, but for bitcoin, you shoud store values as long and not doubles. The unit of account of bitcoin is the satoshi, a hundred millionth of Bitcoin. Since there can only be 21M BTC ever, that's a maximum of 2.1 quadrillion (2.1 * 10^5) satoshis. That number fits in 64 bits.</p>

<p>For Ethereum, you need 256 bits unsigned integers IIRC.</p>
