<p>yes, UINT64 is sufficient, which is in fact how the Bitcoin protocol works internally. The conversion factor from UINT64 to BTC is 1.0e8.</p>

<p>Not using floating point numbers is a very good idea indeed.</p>

CC BY-SA 3.0
2014-08-12T21:30:02.913Z
2014-08-12T21:30:02.913Z
njaard
<p>I need to track an amount of Bitcoins in a database.  Is a UINT64 sufficient?</p>

<p>I'd rather not deal with floating point types, and the rounding errors they end with.</p>

CC BY-SA 3.0
2014-08-12T21:44:29.797Z
The title is catchy but nonsensical.  I am guessing you are trying to keep track of an *amount* of bitcoins (e.g. BTC 3.01329) but that is not clear from your wording
Nate Eldredge
CC BY-SA 3.0
2014-08-12T21:47:16.440Z
@NateEldredge it's tagged development, yes..  I want to know that the max value in a Tx is defined to be 64 bits. I made it clearer
makerofthings7
<development>
How many bits are in a Bitcoin?
makerofthings7
# How many bits are in a Bitcoin?

(Asked by: username_0 on 2014-08-12)

I need to track an amount of Bitcoins in a database. Is a UINT64 sufficient?

I'd rather not deal with floating point types, and the rounding errors they end with.

**Tags:** development

> **Comments:**
> **username_1**: The title is catchy but nonsensical.  I am guessing you are trying to keep track of an *amount* of bitcoins (e.g. BTC 3.01329) but that is not clear from your wording  
> **username_0**: @NateEldredge it's tagged development, yes..  I want to know that the max value in a Tx is defined to be 64 bits. I made it clearer  

---

## 1 answers

### Answer by username_2 on 2014-08-12. Score: 6 | Accepted answer

yes, UINT64 is sufficient, which is in fact how the Bitcoin protocol works internally. The conversion factor from UINT64 to BTC is 1.0e8.

Not using floating point numbers is a very good idea indeed.


---

