user6129: 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. :-)

user6128: you are trying to send amount as string. Sprintf returns string.
You need to send amount as double (in PHP double == float).
Try this way:
$payment_tx = $ifc->sendtoaddress($account['address'], (double)$to_send);
If it doesn't work, use move at first, because sending can fail under many circumstances, while move always works.
Once you are done with that, please read my question about further problems with precision: Can I force json_encode in PHP to output 8 digits after dot for RPC?

6129: <p>I am working with Infinitecoin (another bitcoin fork).<br>
This is my first attempt to make a crypto currency based website.<br>
I use PHP with JSON RPC calls.
In this particular case, I want to use</p>

<pre><code>$payment_tx = $ifc-&gt;sendtoaddress($account['address'], $to_send);
</code></pre>

<p>($ifc is the object returned by the jsonRPcclient() connection)  </p>

<p><code>sendtoaddress()</code> description states :    </p>

<p><em>$amount is a real and is rounded to 8 decimal places.</em><br>
So I formatted "$to_send" as precised in the description, but i'm still getting  :</p>

<p>*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*</p>

<p>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?<br>
I also want to be able to send IFC amounts up to several millions. How ?</p>

<p>Here's how I do the formatting :  </p>

<pre><code>$to_send = sprintf("%.8f", floatval($amount));  
</code></pre>

<p>$amount is retrieved from a database.</p>

<p>Please can somebody enlighten me with what am I doing wrong ?</p>

<p>I can offer some IFC as a thank for your help, if someone want some. :-)</p>
 6128: <p>you are trying to send amount as string. Sprintf returns string.
You need to send amount as double (in PHP double == float).<br>
Try this way:<br></p>

<p><code>$payment_tx = $ifc-&gt;sendtoaddress($account['address'], (double)$to_send);</code></p>

<p>If it doesn't work, use move at first, because sending can fail under many circumstances, while move always works.</p>

<p>Once you are done with that, please read my question about further problems with precision: <a href="https://bitcoin.stackexchange.com/questions/12392/can-i-force-json-encode-in-php-to-output-8-digits-after-dot-for-rpc">Can I force json_encode in PHP to output 8 digits after dot for RPC?</a></p>
