Skip to content

Commit

Permalink
Decimal Values - Fix by areebmajeed/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggedsoft authored Nov 8, 2019
2 parents d421068 + c709ac8 commit c8941f9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ public function marketBuyTest(string $symbol, $quantity, array $flags = [])
* @return integer (signifcant digits) based on the minimum order amount
*/
public function numberOfDecimals($val = 0.00000001) {
$val = sprintf("%.18f", $val);
$parts = explode('.', $val);
$parts[1] = rtrim($parts[1], "0");
return strlen($parts[1]);
Expand Down

0 comments on commit c8941f9

Please sign in to comment.