Skip to content

Commit

Permalink
format the number for unformatted preview if decimals is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
i-just committed Nov 22, 2024
1 parent 73cff72 commit 2ecb86c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fields/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ protected function inputHtml(mixed $value, ?ElementInterface $element, bool $inl
$value = Craft::$app->getFormatter()->asDecimal($value, $this->decimals);
} catch (InvalidArgumentException) {
}
} elseif ($this->decimals) {
} elseif (isset($this->decimals)) {
// Just make sure we're using the right decimal symbol
$decimalSeparator = Craft::$app->getFormattingLocale()->getNumberSymbol(Locale::SYMBOL_DECIMAL_SEPARATOR);
try {
Expand Down

0 comments on commit 2ecb86c

Please sign in to comment.