• Resolved jamiedolan

    (@jamiedolan)


    Hello;

    Thank you for this plugin. I use it on our page that helps with a health condition.

    I have 2 fields and am solving for 75% of the range using this formula: (((prec(fieldname10,2)-prec(fieldname2,2))/4)*3+fieldname2)
    I attempted to add in perc and this still calculates, but is not doing what I want.

    First field: 2.0
    Second Field: 4.2

    Answer:3.6500000000000004

    Answer I want: 3.65

    I’ve been trying for over an hour to figure out how to get this to return just 2 decimal places (3.65). What am I missing?

    Thank you

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

    (@codepeople)

    Hello @jamiedolan,

    Actually, in your equation should be used the PREC operation only one time and as the outer most operation, as follows:

    
    PREC(((fieldname10-fieldname2)/4)*3+fieldname2,2)
    

    and that’s all.
    Best regards.

    Thread Starter jamiedolan

    (@jamiedolan)

    Thank you so much. I had tried that at one point and didn’t get it to work, I must have missed one (. Thank you again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Truncate to 2 decimal points’ is closed to new replies.