I am trying to save Bitcoin data in Mysql. But I am struggling to identify a reliable data format that won’t round out or misrespresent the original value.
Data Formated I tested
decimal(20,20)
double(20,20) –> got converted to decimal(20,20)
float(20,20)
I tried to save this value 123456789,123456789
But it always got rounded out or misrepresented.
Do you need to do any calculations with these values? If not, why not just store them as strings, thus ensuring the db will never change them?
I mean, what if for some reason a bitcoin comes along with 9 digits after the decimal point, the db will mangle it, and you lost yourself a bitcoin. From what I gather those things aren’t cheap, so why risk it?