I have the exact same problem : I need to store 3 decimals float numbers in many objects, but after saving my object and going back to edit it, I can only see a 2 decimals number.
I checked in the ezcontentobject_attribute table in the mysql database and the value is still stored with 3 decimals. That is at least reassuring.
What embarasses me more is that if I edit my object again (in order to change some other attribute value fo example), my float attribute value is stored with only 2 decimals in the database, if I forget to put the 3 decimals value AGAIN and everytime I wish to edit my object.
I think there is an issue here , so if anyone could tell us if there is a setting somewhere to force the attribute value in back office to show more than 2 decimals, it would be nice.
The problem is due to the l10n('number') transformation.
To modify number of digits you have two solutions :
- Tedious but clean : Overriding content/datatype/edit/ezfloat.tpl templates and removing "l10n('number')"
- Simpler but dirty : Editing ./share/locales/eng-GB.ini => [Numbers] FractDigits=4 (instead of 2 if you want 4 decimals).
Why dirty ? : In this case you edit an install wide variable. You thus can't override this variable on a per-siteaccess basis (which would be a great feature).
Thanks a lot for the information. I chose the 2nd solution as I also have some calculated float fields which Id' like to show on the website with 3 decimals, and therefore needed to specify somewhere the number of decimals to show when using l10n function.
But it's true that I'd rather override the locale configuration (in my own extension for example, which would be the cleanest way) than edit the install variable.