Bitcoin Forum
December 10, 2016, 09:18:56 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: TradeHill appears to be using floats  (Read 1267 times)
phantomcircuit
Sr. Member
****
Offline Offline

Activity: 463


View Profile
August 23, 2011, 09:53:13 AM
 #1

If you take a look at their API you can see that they list trades with 10 places after the decimal.

{"date": 1314083175, "tid": 114770, "price": "11.0980810956", "amount": "0.2500000000"}

In order to store that in users accounts that would require storing 20 places after the decimal.

It seems highly unlikely to me that they are actually using 20 places after the decimal to store user account balances.

Possibly someone from trade hill would care to comment.

PS: yes im aware it is dealing with very small amounts
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
davout
Legendary
*
Offline Offline

Activity: 1358


1davout


View Profile WWW
August 23, 2011, 10:08:08 AM
 #2

In order to store that in users accounts that would require storing 20 places after the decimal.
Um. why ?

phantomcircuit
Sr. Member
****
Offline Offline

Activity: 463


View Profile
August 23, 2011, 10:16:39 AM
 #3

In order to store that in users accounts that would require storing 20 places after the decimal.
Um. why ?

You place a bid at 0.0000000001 for 0.0000000001 you now need to record this as a change in your balance of 0.00000000000000000001 BTC and 0.0000000001 USD
davout
Legendary
*
Offline Offline

Activity: 1358


1davout


View Profile WWW
August 23, 2011, 10:36:33 AM
 #4

You place a bid at 0.0000000001 for 0.0000000001 you now need to record this as a change in your balance of 0.00000000000000000001 BTC and 0.0000000001 USD
I doubt they allow orders to be placed with such precise amounts.
Anyway I'm not TH so I should just step aside and let them answer Smiley

Sukrim
Legendary
*
Offline Offline

Activity: 1848


View Profile
August 23, 2011, 12:16:11 PM
 #5

The minimum abount you're able to bid in the webUI is 1 USD.

https://bitfinex.com <-- leveraged trading of BTCUSD, LTCUSD and LTCBTC (long and short) - 10% discount on fees for the first 30 days with this refcode: x5K9YtL3Zb
Mail me at Bitmessage: BM-BbiHiVv5qh858ULsyRDtpRrG9WjXN3xf
enki
Newbie
*
Offline Offline

Activity: 9


View Profile
August 23, 2011, 06:22:02 PM
 #6

actually they just use higher-precision decimals in their database than needed
Jered Kenna (TradeHill)
Sr. Member
****
Offline Offline

Activity: 420



View Profile WWW
August 23, 2011, 06:37:43 PM
 #7

actually they just use higher-precision decimals in their database than needed

Hi Folks,

Enki is correct. We use high precision decimals (not floats) in our database. Additionally, we limit the minimum sizes of transactions.

Regards,
Adam - Tradehill

moneyandtech.com
@moneyandtech @jeredkenna
phantomcircuit
Sr. Member
****
Offline Offline

Activity: 463


View Profile
August 23, 2011, 06:41:59 PM
 #8

actually they just use higher-precision decimals in their database than needed

Hi Folks,

Enki is correct. We use high precision decimals (not floats) in our database. Additionally, we limit the minimum sizes of transactions.

Regards,
Adam - Tradehill

So you are saying that you use a NUMERIC(X,22) for account balances?
helloworld
Full Member
***
Offline Offline

Activity: 182


View Profile
August 24, 2011, 04:49:02 AM
 #9

The minimum abount you're able to bid in the webUI is 1 USD.

Minimum sizes alone wouldn't help the precision issue, so it's good to know they also use high-precision decimals.

example: What if you wanted to trade 5.00000001 btc at a rate of $10.00000001? Minimums don't come into play at all in that case but you still need the precision.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!