Skip to main content
All CollectionsTutorials
Round Amount field
Round Amount field
Updated over a week ago

Note: Now you can round the results in the form field settings.

In some cases, it's useful to round the Amount Field for Elementor Pro Form to a number.

In our example we have two fields:

  • Party cost

  • People

To calculate how many must pay each people you can use this token

[form:party_cost] / [form:people]

If the party costs 1000 $ and you want to divide it for 70 people, each of them will pay 14.2857..... $

To round the amount to an integer, you can use the JavaScript Math.round() function or toFixed()

Math.round( [form:party_cost] / [form:people] )

To round the amount to two decimal places you can use toFixed()

( [form:party_cost] / [form:people] ).toFixed(2)

Did this answer your question?