• Resolved gmw0113

    (@gmw0113)


    So I’m having trouble with a known formula for calculating diameters of rolls.

    When I entered this into google: ((((3.141592654 / 4) * (3^2)) + ((5000 * 12) * (2.5 / 1000))) / (3.141592654 / 4))^0.5

    I get 14.14, which is correct.

    When I apply the exact same formula to a calculated field, just to get it to produce this static number (prior to hooking it up to fields) I get an answer of 191.

    I have no idea how it’s arriving at 191. Please assist, thanks~

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

    (@codepeople)

    Hello @gmw0113

    In javascript does not exist the “^” operator, so, our plugin includes the equivalent POW operation: 3^2 would be POW(3,2)

    Your equation can be implemented as follows:

    
    POW((3.141592654/4 * POW(3,2) + 5000*12*2.5/1000) / (3.141592654 / 4), 0.5)
    

    Best regards.

    Thread Starter gmw0113

    (@gmw0113)

    Awesome, thanks for the super quick reply.

    But, why do you have the entire formula inside “POW”? And why remove all the parens?

    Plugin Author codepeople

    (@codepeople)

    Hello @gmw0113

    I’ve simply removed the unnecessary parenthesis, but you can use them if you want. The complete formula is inside the POW operation because your original formula is composed of (left operations)^(right operations) that in our plugin must be translated into

    POW(left operations, right operations)

    Best regards.

    Thread Starter gmw0113

    (@gmw0113)

    Doesn’t seem to work-

    ((((3.141592654 / 4) * (3^2)) + ((5000 * 12) * (2.5 / 1000))) / (3.141592654 / 4))^0.5

    Would then be:

    POW(((((3.141592654 / 4) * POW((3,2))) + ((5000 * 12) * (2.5 / 1000))) / (3.141592654 / 4)),.5)

    (No console errors are presented either before or after using the ^ or POW())

    • This reply was modified 5 years, 2 months ago by gmw0113.
    • This reply was modified 5 years, 2 months ago by gmw0113.
    Plugin Author codepeople

    (@codepeople)

    Hello @gmw0113

    Your use of the parentheses is incorrect:

    (3^2) = POW(3,2) and not POW((3,2))

    Best regards.

    • This reply was modified 5 years, 2 months ago by codepeople.
    Thread Starter gmw0113

    (@gmw0113)

    Ah yes, I see it now- thanks!!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Another formula issue / calculation issue’ is closed to new replies.