Viewing 1 replies (of 1 total)
  • 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 1 replies (of 1 total)

The topic ‘decimal numbers’ is closed to new replies.