Rounding number in input field


I’ve run into a seemingly simple problem, but haven’t been able to come up with a solution.

I have an input field inside of a repeating group where the user can fill in an amount (currency), with or without decimals. I would like to display this amount rounded to a whole number. So for instance, if a user fills in €500.89, I want this amount to be displayed as €501. I can’t figure out how to do it.

Adding ‘rounded to 0’ in the initial content field doesn’t work.

When I choose content format Decimal with Decimal place 0, the user cannot fill in any decimals.

When I choose content format Integer, the user also cannot fill in any decimals.

When I choose content format Currency and do NOT tick Always show decimals, strangly enough decimals are being displayed.

How do I go about this, any advice?

Can’t understand - where are you trying to display it? Same input where user fills the number?

Yes exactly, in the same input field where the user fills in the amount. So when the user fills in an amount with decimals I want it to be displayed in the same field rounded to the nearest whole number. The decimals still being there, but not visible anymore.

I couldn’t get it to work as I wanted. As an alternative I’ve set up 2 conditions. One with type Integer where the user is forced to fill in an amount without decimals and one with type Decimals with two decimals. Both are connected to a toggle that the user can set. Depending on what the user chooses, the group with type Integer is visible or the group with type Decimals. All groups where amounts are shown I’ve set up the same way.

This topic was automatically closed after 70 days. New replies are no longer allowed.