From bbdccaa639674a1aff522d8684e69bcbd841a43e Mon Sep 17 00:00:00 2001 From: Michael Rubel Date: Tue, 2 Nov 2021 13:27:58 +0100 Subject: [PATCH] swap default number with first item in collection --- src/Collection/LocaleNumberFormatter.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Collection/LocaleNumberFormatter.php b/src/Collection/LocaleNumberFormatter.php index cef2c47..a22e506 100644 --- a/src/Collection/LocaleNumberFormatter.php +++ b/src/Collection/LocaleNumberFormatter.php @@ -38,13 +38,6 @@ class LocaleNumberFormatter implements Formatter */ public int $fraction_digits = 2; - /** - * Default number if $number_key isn't passed. - * - * @var float - */ - public float $default_number = 0; - /** * Format the date and time. * @@ -65,7 +58,7 @@ public function format(Collection $items): string ); return $formatter->format( - (float) $items->get($this->number_key) ?? $this->default_number + (float) $items->get($this->number_key) ?? $items->first() ); } }