• Resolved newlyntinning

    (@newlyntinning)


    Hello all. Hope you can help.
    Now, I am no expert at this but have managed to cobble together a site that works for me.
    I am however completely lost with the Calculated Fields Form By CodePeople.
    What I would like to have is a form where people can add the diameter & height of an item and this is then added together, then multiplied by £0.20
    Example: 200+100×0.20=£60
    Any help would be greatly appreciated as this form is way above my simple mind!!!!!!
    All the best, Steve. Novice WP user.

    Ps. Completly happy to use a different form if that is appropriate?

    • This topic was modified 7 years, 2 months ago by newlyntinning.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    The solution is really simple,

    1. Insert a number field for the diameter (I’ll call it fieldname1, however the plugin assigns the fields names dynamically).

    2. Insert a second number field for the height (I’ll will call it fieldname2).

    3. Finally, you simply should insert a calculated field, and enter the equation below through the attribute “Set equation” in the field’s properties:

    (fieldname1+fieldname2)*0.2

    and that’s all.

    By the way, your equation does not include the required parentheses and in mathematic the multiplication has priority over the sum.

    If you want to display the result with the currency symbol, you simply should insert it through the “prefix” attribute in the calculated field’s properties.

    Best regards.

    Thread Starter newlyntinning

    (@newlyntinning)

    Thanks for the reply. Will take a look.
    A little unsure what you mean here? “By the way, your equation does not include the required parentheses and in mathematic the multiplication has priority over the sum.”
    May well be back for help.
    Thank you, Steve

    Thread Starter newlyntinning

    (@newlyntinning)

    Dont suppose you do a, or can do a video on youtube for this???

    Plugin Author codepeople

    (@codepeople)

    Hello,

    I’m referring to your example: 200+100×0.20=£60, it is wrong.

    200+100*0.20 = 200+20 = 220

    the correct would be:

    (200+100)*0.20 = 300*0.20 = 60

    Best regards.

    Plugin Author codepeople

    (@codepeople)

    Hello,

    We’ve not created a youtube video because the number of possibility is huge, for this reason we have preferred distribute with the plugin 5 predefined forms with different equations, so, the users can use them to understand the plugin or as templates for their projects.

    Best regards.

    Thread Starter newlyntinning

    (@newlyntinning)

    Ah. Yes. I remember the () now for maths. Been a while!!

    Right, I have the two fields, 1 & 2, set as Number. Field 3 contains (fieldname1+fieldname2)*0.2 in the set equation box.

    Do I need to tick one of these? “Read only” is currently ticked.
    Required
    Read Only
    Hide Field From Public Page

    Is this where I put the £ symbol? “Symbol to display at the end of calculated field”
    Thank you

    Thread Starter newlyntinning

    (@newlyntinning)

    Brilliant!!!!
    With your help it is resolved. Was baffled by all the settings.
    https://newlyntinning.com/tinning-service/
    Many thanks and best regards, Steve

    Plugin Author codepeople

    (@codepeople)

    Hello,

    It has been a pleasure. However, I describe below the attributes listed in your previous email.

    – If “Read only” is ticked the calculated field cannot be edited directly by the user, only through the equation.
    – If “Required” is ticked the calculated field cannot be empty.
    – If the “Hide Field From Public Page” is ticked the field won’t be visible in the form.

    Finally, if you want to display the currency symbol in front of the equation’s result, it should be entered through the attribute: “Symbol to display at beginning of calculated field”

    Best regards.

    Thread Starter newlyntinning

    (@newlyntinning)

    Thanks again.
    Please, just one more question. How do I limit the equation to 2 decimal places so I get, for instance, £24.67 & not something like 24.6748064235
    All the best

    Plugin Author codepeople

    (@codepeople)

    Hello,

    You simply should use the “PREC” operation.

    PREC(x,y) returns the number x rounded with y decimal places.

    For example:

    PREC(1.5462,3) = 1.546
    PREC(1.5462,2) = 1.55

    In your case:

    PREC((fieldname1+fieldname2)*0.2,2)

    all the information is available in the documentation page of the plugin:

    https://cff.dwbooster.com/documentation

    If you need additional help implementing your equation we can offer you a custom coding service:

    https://cff.dwbooster.com/customization

    Best regards.

    Thread Starter newlyntinning

    (@newlyntinning)

    Thanks for your time and assistance. You have been of great help and think everything is covered. For now any how!!!
    May well upgrade to premium soon as I see other great options.
    All the best, Steve

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Calculated Fields Form By CodePeople (Help NOVICE with multiplication please)’ is closed to new replies.