How to calculate the cost automatically based on a fix value?

  • rbmans
    Asked on November 20, 2017 at 5:00 AM

    I have a product where one cost is based on a specific value stated by customer. I therefore wonder, would it be possible to have customer type a value, and have the form automatically calculate the cost based on a fixed value in percentage? I'll give you some examples.

    Let's say that customer type 100 then I want the result/ cost to be calculated on 100 x 1.1% = 1.1. If customer types 2500, calculation should be 2500 x 1.1% = 27.5.

    If this is possible, I will replace the item "cost/ bonus". 



     

  • Richie JotForm Support
    Replied on November 20, 2017 at 9:53 AM

    Hello rbmans,

    Yes you can calculate fields and set the value using conditional logic.

    Here is a screen shot.

    How to calculate the cost automatically based on a fix value? Image 1 Screenshot 60

    To achieve this, in your build view go to settings then conditions

    How to calculate the cost automatically based on a fix value? Image 2 Screenshot 71

    Click the + add sign and choose UPDATE/CALCULATED FIELD

    How to calculate the cost automatically based on a fix value? Image 3 Screenshot 82


    In your IF "select the field where your customer inputs his value" in my case its Value then STATE to Is Filled.

    How to calculate the cost automatically based on a fix value? Image 4 Screenshot 93

    Do: Calculate a field's value then ADD FIELD, select the field in your IF then add your calculations. In you summery is where you want to put the output of your calculation.

    . How to calculate the cost automatically based on a fix value? Image 5 Screenshot 104


    Here is the link to my form, feel free to clone it : https://form.jotform.com/73233569416965

    Please let us know if we can be of further assistance.


    Best Regards.

  • rbmans
    Replied on November 20, 2017 at 12:00 PM

    Thanks!

    Took some time to realise that I can't use normal math and %. But using your formula it works.


    A bit curious of why it doesn't work though...

    cheers

  • Kiran Support Team Lead
    Replied on November 20, 2017 at 1:26 PM

    You may also use a form calculation widget to perform calculations on the form without using any conditions. For the provided example, you may set up the formula as shown in the screenshot below:

    151120223020112017 235204 Screenshot 10

    Please refer to the guide below that can help you with using the form calculation widget.

    https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget

    Please get back to us if you need any further assistance. We will be happy to help. 

  • rbmans
    Replied on November 20, 2017 at 1:32 PM

    Thanks, it does work with conditions as well. But only when using formula from above.

    Therefore I am A bit curious of why it doesn't work utilizing normal math or % though...

  • Support_Management Jotform Support
    Replied on November 20, 2017 at 2:45 PM

    I think what you're referring to is the normal percentage calculation.

    e.g.

    25% of 3000 = 750

    10% of 18 = 1.8

    I don't think there's a way to calculate the percentage mathematically without converting it to fraction or decimal first. When solving for percentage, 1.1% of X equates to X * 0.011. So you need to either use fractions as demonstrated on the examples given by my colleagues or go straight to using decimal by dividing the percent% value by 100.

    e.g.

    Use X * 0.011 instead of X * (1.1 / 100)

  • rbmans
    Replied on November 20, 2017 at 3:06 PM

    Thanks for response but I was probably not clear enough. What I meant was that it is not possible to Use X * 0.011 

  • jonathan
    Replied on November 20, 2017 at 4:31 PM

    I am not sure how you meant it was not possible... because using the Form Calculation widget as mentioned already should work for calculation like X * 0.011

    Example: https://form.jotform.com/73236666263966

    1511213325zzz 2017 11 21 05 Screenshot 10

    How to calculate the cost automatically based on a fix value? Image 21


    I hope this help. Let us know if you need further assistance.


  • rbmans
    Replied on November 20, 2017 at 5:03 PM

    ok, actually it does not matter since it works with the formula sen before. Maybe I have to use the widget. I don't do that,. Only the condition settings.

    Any way thanks.


  • Kevin Support Team Lead
    Replied on November 20, 2017 at 7:46 PM

    Please note that the conditions wizard for calculations is similar to the calculation widget wizard so you can do the same too. 

    Here is a guide about it: https://www.jotform.com/help/268-How-to-Insert-Text-or-Calculation-into-a-Field-Using-Conditional-Logic 

    I hope this helps.