• Resolved ccollett

    (@ccollett)


    I was banging my head against my desk trying to figure out why I couldn’t get the sum of to number fields: prepTime-h + cookTime-h

    Turns out, it works when I remove the dash from the field names. prepTimeHours + cookTimeHours works just fine. It should have been obvious to me that the dash is seen as a minus sign. *facepalm*

    Thought I’d share this in case anyone else is having this issue.

    • This topic was modified 4 years ago by ccollett.
Viewing 1 replies (of 1 total)
  • Plugin Author wundermatics

    (@wundermatics)

    Hi @ccollett,

    Thanks for pointing that out and sorry you had to bang your head against the wall in order to figure it out.

    We should definitely do a better job at explaining this in the documentation.

    There is a reason for this however. The underlying math library will interpret the dash as a mathematical minus sign. Imagine the situation where you have these three fields:

    • Sales
    • Total
    • Total-Sales

    If you now create 4th field with the formula: “(Total-Sales)*10” that formula could be interpreted in two different ways. As a multiplication with the field “Total-Sales” OR a multiplication with the difference between “Total” and “Sales” (this is what the library currently will do).

    Again, thanks for pointing this out! Improvements in the docs are on the way.

Viewing 1 replies (of 1 total)
  • The topic ‘Does not work when field name has a dash’ is closed to new replies.