• Resolved rphrus

    (@rphrus)


    Hi,
    How do you prevent numbers from rounding up or down? For example I want the number to include 2 decimals to the right but do not round up or down?

    Thanks for your help.

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

    (@codepeople)

    Hello,

    If you don’t want to use the “PREC” operation:

    PREC(X,Y) rounds the X number to Y decimal places.

    PREC(2.4536,3) = 2.454
    PREC(2.4536,2) = 2.45

    An alternative would be the use of the parseInt operation:

    parseInt(x*100)/100

    For example:

    parseInt(1.23666*100)/100 = 1.23;

    Best regards.

    Thread Starter rphrus

    (@rphrus)

    Thank you, but how would I put using my equation:
    IF(AND(fieldname2),prec(fieldname2/2.2/2*80*5/200,1)

    How can I use the parseInt to replace the PREC above?

    Plugin Author codepeople

    (@codepeople)

    Hello @rphrus,

    The equation would be simply:

    IF(fieldname2,parseInt(fieldname2/2.2/2*80*5/200*100)/100,1)

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Do not round’ is closed to new replies.