We have a Number field that's set to Decimal Points: 0. Entering a decimal value, like 5.6 will round the value up or down in the Control Panel when the entry is saved, displaying (in this case) 6 in the Control Panel. But in the frontend, the field will still output 5.6 instead of 6.
Steps to reproduce
Create a Number field and set the Decimal Points to 0, leave the rest of the settings at the default.
Add the number field to an entry type.
In any entry of that type, enter a decimal value like 5.6 in the Number field (with the accounts Formatting Locale set to English).
Save the entry. Inspect the value in the entry form in the Control Panel, and output it in a frontend template.
Expected behavior
Decimal values should be rounded up or down upon saving, or display a validation error.
Actual behavior
The Control Panel and frontend output show different values.
What happened?
Description
We have a Number field that's set to Decimal Points:
0
. Entering a decimal value, like5.6
will round the value up or down in the Control Panel when the entry is saved, displaying (in this case)6
in the Control Panel. But in the frontend, the field will still output5.6
instead of6
.Steps to reproduce
0
, leave the rest of the settings at the default.5.6
in the Number field (with the accounts Formatting Locale set to English).Expected behavior
Decimal values should be rounded up or down upon saving, or display a validation error.
Actual behavior
The Control Panel and frontend output show different values.
Craft CMS version
5.5.1.1
PHP version
8.3
Operating system and version
No response
Database type and version
MySQL 8
Image driver and version
No response
Installed plugins and versions
-