Skip to content

Commit

Permalink
[Bug]: Fix null value exception in Numeric (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
zieglerh authored Mar 7, 2024
1 parent 142a82c commit 64c30be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ConfigElement/Value/Numeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ public function getLabeledValue($object)
if ($this->formatNumber) {
$formatter = \Pimcore::getContainer()->get(\Pimcore\Localization\IntlFormatter::class);

//TODO consider precision
$labeledValue->value = $formatter->formatNumber($labeledValue->value);
if (!$labeledValue->empty) {
//TODO consider precision
$labeledValue->value = $formatter->formatNumber((float)$labeledValue->value);
}
}

return $labeledValue;
Expand Down

0 comments on commit 64c30be

Please sign in to comment.