Continuing the discussion from Show rounded number, but keep it internally more precise:
@tjorben-atomic-moss was looking for an elegent solution for rounding numbers in the UI but keeping full precision in the data.
Can the Localization API be used to round all numbers in the UI? It seems that I could create a DataFormat with optional ValueConversion.
Is this a sensible way forward or am I grabbing at straws?
The Localization API uses the Conversion API (ValueConversion) to handle the value between the UI and the document, see methods ValueConversion.parse and ValueConversion#format. The Conversion API can be customized, that means that the project could provide its own implementation of e.g. the method ValueConversion.format to achieve the wanted rounding (for all other fields or fieldtypes the default implementation can be used). What I don’t know is if the method ValueConversion.parse is called for computed fields.
Peace 
Furthermore the solution would be for all inputs. If i want it more selective i might need access to the model which seems not possible (pls prove me wrong), for having access to annotations for example, to decide if i should round the number or not.
Hi @tjorben-atomic-moss,
you can access the annotations within models; we’ve mentioned thoroughly in the frontend tutorial.
Hope that helps
@loi-risen-dale
Thanks
Unfortunately it seems not possible within the ValueConversion class and there i wanted to make the UI conversion. During thinking about it i think this solution wouldn’t work, because the convert back to the document won’t work, so overriding the component would be the solution then.