Rounding rules IMPORTANT

  • adminafas
    Asked on May 26, 2020 at 5:49 AM

    i'd like to round up all the numbers to integer with final figure 0 or 5

    example of how I wish it worked:

    1590486334Schermata 2020 05 26 alle 11 Screenshot 10

    1590486427Schermata 2020 05 26 alle 11 Screenshot 21

    the problem is because I have a small shop and at the end of the day at the bank, I can only pour cash and not coins

  • Ariel JotForm Support
    Replied on May 26, 2020 at 7:28 AM

     Hi adminafas,

    We can attain this, by using three Conditional Logic calculations.

     

    The easy part is calculating for TOTALE VERSAMENTO. We only need to get the sum of number1 and number2. The conditional logic would look something like this:

    15904908172020 05 26 18 57 04 Window Screenshot 10

    1. A regular check to see if the fields number1 and number2 are filled.
    2. Make sure 'ALL' fields mentioned above met the 'filled' condition.
    3. number1 + number2
    4. Store the result in
    TOTALE VERSAMENTO.



    To get TOTALE EFFETTIVO, we can divide it by 5 to meet your figure 0 or 5 condition, use the floor function to get nearest integer down from the result, then multiply it by 5.

    15904915492020 05 26 19 10 53 Window Screenshot 21

    1. Check if TOTALE VERSAMENTO has a value.
    2. floor(TOTALE VERSAMENTO / 5) * 5
    3. Store the result in TOTALE EFFETTIVO

     

    Finally, Arrotondamento is as simple as getting the difference of TOTALE EFFETTIVO and TOTALE VERSAMENTO.

    15904922412020 05 26 19 22 48 Window Screenshot 32

     

    1. Check if TOTALE EFFETTIVO has a value.
    2.
    TOTALE VERSAMENTO - TOTALE EFFETTIVO
    3. Put the result in
    Arrotondamento

     

    Here's a sample for to try it out:
    https://form.jotform.com/201462674501954

     

    Hope that helps! Don't hesitate to reach out if you need further assistance.

  • adminafas
    Replied on May 26, 2020 at 11:26 AM

    you are the boss! thank you

  • adminafas
    Replied on June 1, 2020 at 6:01 AM

    how can I not allow this number to be changed?

    1591005641Schermata 2020 06 01 alle 11 Screenshot 10


    1591005665Schermata 2020 06 01 alle 11 Screenshot 21

  • roneet
    Replied on June 1, 2020 at 9:23 AM

    To avoid confusion, we have moved the new concern in a separate thread:

    https://www.jotform.com/answers/2359711

    We will address it shortly.

    Thanks.