• Resolved vtje

    (@vtje)


    Hello,

    I have a problem with this calculation (I want to round the result of the calculation to a decimal place).

    (113/fieldname3*(fieldname4+fieldname5-fieldname2)-fieldname6)

    fieldname2= 70.3 (can be any number)
    fieldname3= 126 (can be any number)
    fieldname4= 85 (if you use this, fieldname5 is empty
    fieldname5= empty (if you use this, fieldname4 is empty)
    fieldname6= empty (can be -1/0/1/2/3/)
    result with given numbers: 13.183333333333337
    I want to round this to: 13.2

    I have tried everything, with no result.

    Who can help me with this?

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

    (@codepeople)

    Hello @vtje

    Please, use the PREC operation as the outermost operation in the equation.

    PREC(X,Y) rounds the number X with Y decimal places.

    So, if you want the result with only one decimal place, the equation would be:

    
    PREC(113/fieldname3*(fieldname4+fieldname5-fieldname2)-fieldname6, 1)
    

    For two decimal places:

    
    PREC(113/fieldname3*(fieldname4+fieldname5-fieldname2)-fieldname6, 2)
    

    More information about the rounding operations in the plugin in the following post of the plugin’s blog:

    https://cff.dwbooster.com/blog/2020/09/20/rounding-numbers/

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Round function …’ is closed to new replies.