• Resolved nsperfeld

    (@nsperfeld)


    Hii,

    My plugin version is 1.0.377 Free.

    I`m trying to make a calculator for a pet food client.

    I need to calculate the amount of food the dog needs, based on the weight of the pet.

    The formula is: ((130 * (POW(fieldname2,fieldname7)) * 10/3606) * 100)

    Fieldname2 = The weight coming for the client.
    Fieldname7 = 0,75 – The value that I need to do the math on this place. (I put it as a hidden field in order to try to make it work 🙁

    But it just doesn’t calculate anything.

    Did I do something wrong with the equation?

    Thanks in advance for making this great tool.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @nsperfeld

    The error is not in the equation, the error is in the value of the fieldname7 field. In javascript the decimal separator is the dot (.) symbol, and not the comma (,). So, the value would be 0.75

    Best regards.

    Thread Starter nsperfeld

    (@nsperfeld)

    Woow, many thanks, such a tiny little detail.

    Just one more question, how can I limit the result to have no decimal number, just the full number before the . on the result?

    Plugin Author codepeople

    (@codepeople)

    Hello @nsperfeld

    Simply use the ROUND operation in the equation:

    
     ROUND((130 * (POW(fieldname2,fieldname7)) * 10/3606) * 100)
    

    Best regards.

    Thread Starter nsperfeld

    (@nsperfeld)

    Thank you so much, you`re the best.

    Best regards. Keep up with the good work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I`m having trouble with a specific Equation’ is closed to new replies.