• Resolved torqueing

    (@torqueing)


    I’m going to kick myself when you show me but for the life of me I can’t seem to get the current calculated field to round to two decimal places.

    Because IF(fieldname10 < fieldname7), fieldname7 - fieldname10) gave me lots of digits I edited it to prec( IF(fieldname10 < fieldname7), fieldname7 - fieldname10),2 but I seem to have gone wrong somewhere.

    It just returns the number 2

    • This topic was modified 7 years, 1 month ago by torqueing.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @torqueing,

    First, the operation “IF” has not been used correctly, this operation requires three parameters:

    IF(condition, operations if condition is true, operations if condition is false)

    and you are using this operation with only two parameters.

    Second, the PREC operation requires two parameters, and you are not closing the parenthesis.

    So, the correct structure would be:

    
    PREC(IF(condition, operations if condition is true, operations if condition is false), 2)
    

    Of course, in the previous structure you should use the correct fields’ names and the operations.

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Calculated field to two decimal places with prec’ is closed to new replies.