Skip to content

Commit

Permalink
changed/change-ci-version auto-commit
Browse files Browse the repository at this point in the history
ahumadamatias committed Dec 3, 2024
1 parent af6cf0a commit f9fac32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CryptoQr.php
Original file line number Diff line number Diff line change
@@ -81,9 +81,10 @@ public function getAmountString(): string
$amount = $this->getAmount();
$string = (string) $amount;

/** @var array{array, $matches int, string, int} */
if (preg_match('~\.(\d+)E([+-])?(\d+)~', $string, $matches) === 1) {
$decimals = $matches[2] === '-' ? strlen($matches[1]) + $matches[3] : 0;
$string = number_format($amount, $decimals, '.', '');
$string = number_format($amount, (int) $decimals, '.', '');
}

return $string;

0 comments on commit f9fac32

Please sign in to comment.