user6539: What's the decimal storage requirement in ms sql for bitcoin?
GAAP standard quotes decimal (13, 4) for money.
Is decimal (13,8) preferred for bitcoin or something else?

user16: I would take a different approach and simply use an 8-byte integer value.  This is because all bitcoin transaction values are stored as integers and since float decimal math can vary from architecture to architecture, I'd recommend using integer values whenever possible.
Bitcoin has a fixed decimal place of 8-digits.  If you want to display this information to an end-user just format the integer value to represent the appropriate number of decimals, when the value needs to be displayed.

user13530: Since Bitcoin's precision is 8 decimal numbers, decimal (13, 4) won't cut it. So you better go with (13, 8).

user-1: You need at least DECIMAL(16,8) to store any valid Bitcoin amount (i.e. up to just over 20 Million Bitcoin, requiring 8 digits to the left of the decimal point) precisely (i.e. down to a single Satoshi, requiring 8 digits to the right of the decimal point).
Depening on your application and how you (or your collaborators) think of Bitcoin amounts, it may be preferable to process them in Satoshi, enabling you to treat them as integers (BIGINT would then be the SQL datatype). Of course, then you have traded the dangers around non-integer handling for those associated with large integer handling.

6539: <p>What's the decimal storage requirement in ms sql for bitcoin?</p>

<p><a href="http://www.fasab.gov/accounting-standards/authoritative-source-of-gaap/" rel="nofollow">GAAP</a> standard quotes decimal (13, 4) for money.</p>

<p>Is decimal (13,8) preferred for bitcoin or something else?</p>
 16: <p>I would take a different approach and simply use an 8-byte integer value.  This is because all bitcoin transaction values are stored as integers and since <strike>float</strike> decimal math can vary from architecture to architecture, I'd recommend using integer values whenever possible.</p>

<p>Bitcoin has a fixed decimal place of 8-digits.  If you want to display this information to an end-user just format the integer value to represent the appropriate number of decimals, when the value needs to be displayed.</p>
 13530: <p>Since Bitcoin's precision is 8 decimal numbers, decimal (13, 4) won't cut it. So you better go with (13, 8).</p>
 -1: <p>You need at least <code>DECIMAL(16,8)</code> to store any valid Bitcoin amount (i.e. up to just over 20 Million Bitcoin, requiring 8 digits to the left of the decimal point) precisely (i.e. down to a single Satoshi, requiring 8 digits to the right of the decimal point).</p>

<p>Depening on your application and how you (or your collaborators) think of Bitcoin amounts, it may be preferable to process them in Satoshi, enabling you to treat them as integers (<code>BIGINT</code> would then be the SQL datatype). Of course, then you have traded the dangers around non-integer handling for those associated with large integer handling.</p>
