Bitcoin Forum
April 22, 2018, 01:49:55 AM *
News: Latest stable version of Bitcoin Core: 0.16.0  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: TradeHill appears to be using floats  (Read 1369 times)
phantomcircuit
Sr. Member
****
Offline Offline

Activity: 463
Merit: 250


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
1524361795
Hero Member
*
Offline Offline

Posts: 1524361795

View Profile Personal Message (Offline)

Ignore
1524361795
Reply with quote  #2

1524361795
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1524361795
Hero Member
*
Offline Offline

Posts: 1524361795

View Profile Personal Message (Offline)

Ignore
1524361795
Reply with quote  #2

1524361795
Report to moderator
1524361795
Hero Member
*
Offline Offline

Posts: 1524361795

View Profile Personal Message (Offline)

Ignore
1524361795
Reply with quote  #2

1524361795
Report to moderator
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1002


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
Merit: 250


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: 1372
Merit: 1002


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: 2324
Merit: 1002


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://www.coinlend.org <-- automated lending at various exchanges. No fees(!).
Mail me at Bitmessage: BM-BbiHiVv5qh858ULsyRDtpRrG9WjXN3xf
enki
Newbie
*
Offline Offline

Activity: 9
Merit: 0


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
Merit: 250



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
Merit: 250


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
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



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!