# Hi everyoneI'm working on a form for a contest, people will populate th

• pablo_randel
Asked on May 16, 2019 at 03:25 PM

Hi everyone

I'm working on a form for a contest, people will populate the blank space with the amount of their purchase at the store. This number needs to be divisible by 15. The result has to be rounded to the nearest whole number. The dynamic is that each purchase of 15 gives them 1 ticket for the contest.

So if they spend 20 will have just 1 ticket, if they spend 29 will have 1 ticket, it will change to 2 only if they spend 30, 3 for 45, etc.

Is there a way to calculate this?

This is a re-post of a comment on Form Calculation - Math Function Reference

• stevenmarshall
Answered on May 16, 2019 at 05:49 PM

Hi @pablo_randel,

Can you give us the form URL you are working on? We could assist in setting this up. It might come down to using a few different options for the requirements you are requesting.

• pablo_randel
Answered on May 16, 2019 at 06:02 PM

Hi Steven

That's great!

This is the form: https://www.jotform.com/build/91325486354865

Where is says: "Cantidad de Acciones para Participar" is where the calculation results will display the numbers of tickets earned, depending of the amount of the purchase on "Monto de la Compra"

• Kevin_G
Answered on May 16, 2019 at 08:07 PM

Thanks for providing the form in question.

I'm a bit confused about the example you provided.

The result has to be rounded to the nearest whole number. The dynamic is that each purchase of 15 gives them 1 ticket for the contest.

When you way "the result" are you referring to the division of the entered number with 15 (Number/15)?

Or are you referring to the entered number only?

So if they spend 20 will have just 1 ticket, if they spend 29 will have 1 ticket, it will change to 2 only if they spend 30, 3 for 45, etc.

May you please kindly provide a clear example about the result you are expecting?

For example, as I understand, this is how it would work:

Spent amount: 20 - 29 Tickets: 1

Spent amount: 30 - 39 Tickets: 2

Spent amount: 40 - 49 Tickets: 3

Is this logic correct?

Please kindly provide as many details as possible to we can find a workaround.

Thanks.

• pablo_randel
Answered on May 16, 2019 at 08:24 PM

Hi Kevin thanks for the follow up

I will try to explain different:

For every 15 USD spent, people will receive 1 ticket. (There is no fractions, only integer number)

Ex. I spent at the store \$356. So I will receive 23 tickets (356 / 15 =  23.7333... should display at the result field: 23 tickets total)

Note: I'm using USD dollars for the examples, on the form is different currency.

Thanks

• Kevin_G
Answered on May 16, 2019 at 09:58 PM

Thank you for the explanation, this indeed helps a lot.

I would recommend you to try doing the following: