WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Float type problem

[Resolved] Float type problem

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

    @codepeople

    Hi,

    It is a common issue with javascript engine and the mathematical operations with float numbers, to solve the issue use the operation “prec”

    for example if “a” is fieldname1 (to use the same fields’ names in “Calculated Fields Form”), the equation would be:

    prec(fieldname1*fieldname1,2)

    If fieldname1 has the value 5.2 the operation result would be 27.04

    Now, if you want a more precise result, use a bigger number as second parameter of “prec” operation, for example in:

    prec(fieldname1*fieldname1,4)

    the operation result would be 27.0400

    vasilybodnarchuk
    Member

    @vasilybodnarchuk

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Float type problem’ is closed to new replies.