title: paypal php sdk issues with float while going to live
body: <p>I'm writing a custom paypal gateway for woocommerce using paypal rest api.
  I've almost done, everything is working fine while testing with sandbox account. But after switching to Live, i got a lot of errors "Currency amount must be non-negative number"
  This is what i got:</p>
  
  <pre><code>PayPal\Core\PayPalHttpConnection : ERROR: Got Http response code 400 when accessing https://api.paypal.com/v1/payments/payment. {"name":"VALIDATION_ERROR","details":[{"field":"transactions[0].item_list.items[0].price","issue":"Currency amount must be non-negative number, contain exactly 2 decimal places separated by '.' (JPY contains 0 decimal places), optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code"},{"field":"transactions[0].amount.details.subtotal","issue":"Currency amount must be non-negative number, contain exactly 2 decimal places separated by '.' (JPY contains 0 decimal places), optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code"},{"field":"transactions[0].amount.total","issue":"Currency amount must be non-negative number, contain exactly 2 decimal places separated by '.' (JPY contains 0 decimal places), optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code"}],"message":"Invalid request - see details","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"dc60e0012af71"}
  </code></pre>
  
  <p>I think the problem is here:</p>
  
  <pre><code>if ($dec == 0) $myprice = ceil($myprice);
              else $myprice = round($myprice, $dec);}
              $myprice = doubleval($myprice);
              return $myprice ;
  </code></pre>
  
  <p>When I change the value of $myprice to an integer it work fine but with this it doesn't work. Even with Number_format the problem is the same. 
  Can somebody please help me?</p>