• Resolved jflahiff

    (@jflahiff)


    Super weird problem
    If you enter
    201 in the number of employees field
    5% (or any percentage really) in the turnover field
    $50 (or any amount) in the Average Hourly Rate field

    it returns reasonable numbers
    Now enter 201 employees… reasonable based on our calculations
    202 employees reasonable again
    203 WILDLY OUT OF RANGE
    204 reasonable.

    208 WILDLY OUT OF RANGE

    the pattern is every 5 it goes wacco!
    happy to share more
    Any thoughts?

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

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

    (@codepeople)

    Hello @jflahiff

    The issue is not weir. The javascript engine implemented by browsers has an issue with mathematical operation between floats. Please, look at the screenshot image. I’ve evaluated the mathematical operation 15.3/3 directly in the browser’s developers console. The correct result is 5.1, but it returns 5.1000000000000005:

    Our plugin implements the PREC operation to fix the issue. PREC(X,Y) returns the number X rounded to Y decimals.

    You can edit the equation in the fieldname5 as follows PREC(6.5*fieldname13*7, 2)

    Please, edit the other equations in a similar way too.

    There are other issues with the fields settings. In the fields fieldname11 and fieldname12, you entered the same symbol, the point symbol (.), in both attributes, “Symbol to display at the end of calculated field” and “Decimals separator symbol” causing a conflict.

    Please, remove the point symbol from the “Symbol to display at the end of calculated field” attribute in both fields.

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Wildly inaccurate number’ is closed to new replies.