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

    (@codepeople)

    Hi,

    You can get this result from with a simple mathematical equation.

    y = ROUND(x/5)*5

    I’ll follow the previous equation with two values, 27 and 28.
    For 27, the nearest multiple of 5 is 25, but for 28, the nearest multiple of 5 is 30.

    With 27:
    y = ROUND(27/5)*5 = ROUND(5.4)*5 = 5*5 = 25
    y = 25

    With 28:

    y = ROUND(28/5)*5 = ROUND(5.6)*5 = 6*5 = 30
    y = 30

    If the value is set in the fieldname1, the equation would be:

    ROUND(fieldname1/5)*5

    That’s all.
    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Rounding Integers to Nearest Multiple of 5’ is closed to new replies.