Skip to content

Commit

Permalink
refactor: handle overriding currency decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley committed Aug 29, 2024
1 parent b41d58a commit 8debebb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NumberFormatter/Concerns/HasCustomFormatters.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function formatWithCurrencyCustom(int | float | string $value, string $cu
$result = $this->formatWithDecimal((float) $value);

if (Str::contains((string) $value, '.')) {
$result = number_format((float) ResolveScientificNotation::execute((float) $value), $decimals ?? 8);
$result = number_format((float) ResolveScientificNotation::execute((float) $value), $decimals ?? config('currencies.decimals.crypto', 8));

if (Str::contains((string) $result, '.')) {
$result = rtrim(rtrim((string) $result, '0'), '.');
Expand Down

0 comments on commit 8debebb

Please sign in to comment.