Skip to content

Commit

Permalink
decimal_to_precision fixes in Exchange.php fix #2171 fix #2397
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed May 31, 2018
1 parent a7d9e9b commit 839ad03
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions php/Exchange.php
Expand Up @@ -1852,6 +1852,8 @@ public static function decimal_to_precision ($x, $roundingMode = ROUND, $numPrec

$hasDot = strpos ($result, '.') !== false;
if ($paddingMode === NO_PADDING) {
if ($result === '' && $numPrecisionDigits === 0)
return '0';
if ($hasDot) {
$result = rtrim ($result, '0.');
}
Expand Down

0 comments on commit 839ad03

Please sign in to comment.