Bitcoin Forum
July 29, 2024, 06:34:42 AM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: PHP RPC move float problem  (Read 448 times)
alojzikftp (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
July 24, 2013, 04:22:50 PM
 #1

Hello,
nice to meet you all.
I cannot cope with such problem:
I want to move BTC with move RPC command in PHP using jsonrpcphp recommended in bitcoin wiki.
The syntax is move(string fromAccount, string toAccount, float amount).

And obviously, amounts like 19999999.99999999 cause error.
What would be the best option in order to avoid it?



ds2013
Member
**
Offline Offline

Activity: 111
Merit: 10



View Profile WWW
July 24, 2013, 05:08:40 PM
 #2

I guess you just don't have so much BTC in your wallet :-)

Without code and without error message nobody can help you.

alojzikftp (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
July 24, 2013, 05:17:38 PM
 #3

I guess you just don't have so much BTC in your wallet :-)

Without code and without error message nobody can help you.

Well, I supposed it's obvious what kind of error it is Tongue
Moving 17999999.99999999 BTC (18 * 10^6 - 1 satoshi) moves 18000000 and that's my error. Of course I know it is float fault, but I want to find some nice option to avoid that.

Now I see few possibilities:
1) Modify bitcoind to use string instead float or satoshi, but it is uncomfortable
2) There is a problem with rpc library, so I should modify library, use curl, etc.

I would like universal solution in terms of protocol, so moving this amount should be correct Smiley.
Cheers

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!