How can I round up the figure in the below form

  • 2daystelecom
    Asked on October 25, 2020 at 7:39 AM

    How can I round up the figure in the below form

    At the delivery fee space

    https://www.jotform.com/build/202962562738564#preview

    Jotform Thread 2654174 Screenshot
  • Cecile JotForm Support
    Replied on October 25, 2020 at 10:58 AM

    Hello,

    You can use the round() function in the Form Calculation widget.

    1.Click ... in your Form Calculation widget

    1603637333 5f95905583fd8 48 Screenshot 10

    2.Choose round()1603637353 5f9590695f805 50 Screenshot 21

    3. Populate it with your formula1603637402 5f95909ac3017 47 Screenshot 32

    Result:

    1603637445 5f9590c5ab0ca 46 Screenshot 43

    Calculation : 6.1 * 1.05 = 6.405

    Our forms will not have similar results because you have a condition in your Form Calculation widget. Your formula (distance * 1.05) will not work because of this condition. To avoid this, you may disable or delete the condition.

    1603637543 5f959127e7a92  Screenshot 54

    Let us know if you need further assistance.

  • 2daystelecom
    Replied on October 25, 2020 at 11:27 AM

    Thanks Cecile for the response. I am trying to get a base amount that will be hidden and automatically adds up to the total fare in the delivery fee section:

    For example: Fare quote + Base (hidden) = Total Delivery.

    I am struggling a bit with the calculation

  • Cecile JotForm Support
    Replied on October 25, 2020 at 12:36 PM

    To clarify,

    Do you want your Delivery Fee to be based on the calculation below ?

    Fare quote + Base (hidden) = Total Delivery

    If that is the case, all you need to do is replaced 1.05 with your Base field.

    1603643212 5f95a74cdb5c9  Screenshot 10

    However, this will show your base field before getting the Fare Quote.

    1603643596 5f95a8cc42e73 63 Screenshot 21

    If you don't want this to happen, you can delete the calculation in your Form Calculation widget and add the following condition:

    1603643678 5f95a91eb6944 64 Screenshot 32

    Please do not hesitate to ask further questions.

  • 2daystelecom
    Replied on October 25, 2020 at 12:51 PM

    Yes please that is exactly what I want:

    Do you want your Delivery Fee to be based on the calculation below ?

    Fare quote + Base (hidden) = Total Delivery


    But I do not want the base to show before the total fee, I want that to be added to the fare quote

  • Cecile JotForm Support
    Replied on October 25, 2020 at 1:21 PM

    Thank you for clarifying. If that is the case, please follow my second suggestion.

    1.Delete the calculation in your Form Calculation Widget. So, it should be empty like the one below.

    1603646288 5f95b35035cdb  Screenshot 10

    2.Add the following condition

    1603646220 5f95b30c2a267 69 Screenshot 21

    You may follow this guide if you are not familiar with adding conditions: https://www.jotform.com/help/268-how-to-insert-text-or-calculation-into-a-field-using-conditional-logic

    Please try this one and let us know how it goes.


  • 2daystelecom
    Replied on October 25, 2020 at 1:32 PM

    Hello Cecile,

    It works like magic. Thanks so much

  • 2daystelecom
    Replied on October 25, 2020 at 1:38 PM

    Please do I adjust the figure in the Fare Quote? I can see the base but cannot see the one in the Fare Quote

  • Kenneth JotForm Support
    Replied on October 25, 2020 at 5:55 PM

    Hi there,

    Please note that the Driving Distance Widget only calculates the distance therefore will return a value in Kilometers, so if you intend to calculate the fare, you will have to make a calculation for it.

    Here is my suggestion:

    round((FARE QUOTE * Fare_per_1_km)+Base)

    I hope that helps.

    Best.