Author

Topic: TradeHill appears to be using floats (Read 1438 times)

sr. member
Activity: 266
Merit: 250
August 24, 2011, 12: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.
sr. member
Activity: 463
Merit: 252
August 23, 2011, 02: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?
sr. member
Activity: 420
Merit: 250
August 23, 2011, 02: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
newbie
Activity: 9
Merit: 0
August 23, 2011, 02:22:02 PM
#6
actually they just use higher-precision decimals in their database than needed
legendary
Activity: 2618
Merit: 1006
August 23, 2011, 08:16:11 AM
#5
The minimum abount you're able to bid in the webUI is 1 USD.
legendary
Activity: 1372
Merit: 1007
1davout
August 23, 2011, 06: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
sr. member
Activity: 463
Merit: 252
August 23, 2011, 06: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
legendary
Activity: 1372
Merit: 1007
1davout
August 23, 2011, 06:08:08 AM
#2
In order to store that in users accounts that would require storing 20 places after the decimal.
Um. why ?
sr. member
Activity: 463
Merit: 252
August 23, 2011, 05: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
Jump to: