• Resolved kkmarch7

    (@kkmarch7)


    Hello,

    I am having an issue with the calculation result showing too many numbers after the coma. I have tried changing the calculation in numerous ways but still there is an additional unnecessary number in the result.

    These are the equations I have used:

    fieldname3_1*fieldname6_1-(0.03*fieldname3_1+3000+fieldname7_1)

    PREC((0.03*fieldname3+3000+fieldname5) – fieldname3*fieldname4,2)

    PREC(0.03*fieldname3+3000+fieldname5) – (fieldname3*fieldname4,2)

    Please let me know what I am missing

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

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

    (@codepeople)

    Hello @kkmarch7

    The PREC operation requires two parameters PREC(X,Y) rounds the number X with Y decimals. In your code, the parentheses are wrong and generate a parser error. Furthermore, the equations must be entered into the “Set Equation” attribute of the calculated field, and not into the onclick event of the button.

    Please, enter the following equation into the “Set Equation” attribute in the settings of the calculated field:

    
    PREC(0.03*fieldname3+3000+fieldname5 - fieldname3*fieldname4,2)
    

    If you don’t want to evaluate the equations dynamically, only by pressing a button:

    1. Untick the checkbox: “Eval dynamically the equations associated to the calculated fields” in the “Form Settings” tab.

    2. Insert a button in the field and select as the button’s type the “Calculate” option. You don’t need to enter any special code into the onclick event.

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Decimal Point’ is closed to new replies.