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

    (@codepeople)

    Hi,

    Yes of course, for example, if you insert two calculated fields in the form, I’ll call to these fields as: fieldname1 and fieldname2. It is possible define, as the equation associated to the fieldname1 field, 2.25+2.31

    and as the equation associated to the fieldname2 field:

    fieldname1*0.61

    Best regards.

    Thread Starter mrfordx

    (@mrfordx)

    Sorry, I don’t think I explained myself well sorry. Lets try again.

    fieldname1 – (user input)
    fieldname2 – (user input)
    calculatedvalue = fieldname1+fieldname2

    then to take the numbers to the right of the decimal from the calculated value and use that in a different calculated value.

    Plugin Author codepeople

    (@codepeople)

    Hi,

    To take the decimal digits of a number you simply should use the operation FLOOR (the previous integer number) as follows:

    123.45 – FLOOR(123.45) = 123.45-123 = 0.45

    So, if the calculated field is the fieldname4, and the equation is: fieldname5 multiplied by the decimal digits of fieldname4, it can be represented as:

    fieldname5*(fieldname4-FLOOR(fieldname4))

    another solution is using the rest of integer division:

    fieldname5*(fieldname4%1)

    but in the last case the way that javascript implements the operations with decimal numbers can generate more inaccurate results.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘right of the decimal numbers’ is closed to new replies.