Start of change

ROUNDTOEVEN

ROUNDTOEVEN returns the value of x rounded at a digit specified by n following the rounding rule of round half to even.

Read syntax diagramSkip visual syntax diagram
>>-ROUNDTOEVEN(x,n)--------------------------------------------><

x
A real expression that is FIXED DECIMAL or DFP FLOAT. If x is negative, the nearest even value is rounded and the sign is restored.
n
An optionally-signed integer that specifies the digit at which rounding is to occur.

The ROUNDTOEVEN built-in function is basically same as the ROUNDAWAYFROMZERO built-in function except that the ROUNDAWAYFROMZERO function rounds ties away from the zero. For example, under the ROUNDAWAYFROMZERO function, 24.5 gets rounded to 25 and -24.5 gets rounded to -25. However, under the ROUNDTOEVEN function, both 23.5 and 24.5 get rounded to 24 and both -23.5 and -24.5 get rounded to -24.

End of change