From 8debebb6195971ab5fd8cebad883bf9dab0b3b33 Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Fri, 30 Aug 2024 00:58:49 +0100 Subject: [PATCH] refactor: handle overriding currency decimal places --- src/NumberFormatter/Concerns/HasCustomFormatters.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NumberFormatter/Concerns/HasCustomFormatters.php b/src/NumberFormatter/Concerns/HasCustomFormatters.php index dae2dbc7..9f228823 100644 --- a/src/NumberFormatter/Concerns/HasCustomFormatters.php +++ b/src/NumberFormatter/Concerns/HasCustomFormatters.php @@ -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'), '.');