Rounding Float for Display While Preserving Original Value to be saved into DB table

I have a client who wants to enter a float value, round it to a whole number for display purposes, but still save the original float value to the database. How can I achieve this, since changing the format or number type of the component removes the decimal values from the float property?

Please add the 'vision' or 'perspective' tag to your question title. The answer depends on that information.

  1. Don't use a text field for numbers. Use a numeric field and its formatting feature.

  2. Don't use transforms on entry field's value bindings--that breaks bidirectionality.

1 Like

Understood, but using the formatting feature truncates the decimal in the float value property which I'll need to save it onto the database.

Then use a numeric entry field without formatting to enter the value with full precision, and display the value formatted with a label and a numberFormat() expression binding. If you cannot meet both requirements in a single component, then don't use a single component.

1 Like

Noted on this