1
I am working with Infinitecoin (another bitcoin fork).
This is my first attempt to make a crypto currency based website.
I use PHP with JSON RPC calls.
In this particular case, I want to use
$payment_tx = $ifc->sendtoaddress($account['address'], $to_send);
($ifc is the object returned by the jsonRPcclient() connection)
sendtoaddress() description states :
$amount is a real and is rounded to 8 decimal places.
So I formatted "$to_send" as precised in the description, but i'm still getting :
*Stack trace: #0 /opt/lampp/htdocs/site/process_payment.php(30): jsonRPCClient->__call('sendtoaddress', Array) #1 /opt/lampp/htdocs/site/process_payment.php(30): jsonRPCClient->sendtoaddress('iKCBBVAfacVuabG...', '10920.00000000') #2 {main} thrown in /opt/lampp/htdocs/site/jsonRPCClient.php on line 140*
I really don't understand why, because I intend to send exactly 10920 Infinitecoins to the address starting with iKCBBVAfacVuabG ... and this is formatted the right way, right?
I also want to be able to send IFC amounts up to several millions. How ?
Here's how I do the formatting :
$to_send = sprintf("%.8f", floatval($amount));
$amount is retrieved from a database.
Please can somebody enlighten me with what am I doing wrong ?
I can offer some IFC as a thank for your help, if someone want some. :-)