EGL carries out the rounding by adding 5 to the place to the right of the rounding point, then setting that place and all lower places to zero.
mathLib.round( numericVariable DECIMAL | SMALLFLOAT | FLOAT in, powerOf10 INT in) returns (result DECIMAL | SMALLFLOAT | FLOAT)
In the first example, the variable balance is rounded to the nearest thousand:
balance FLOAT = 12345.6789; rounder INT = 3; balance = mathLib.round(balance, rounder); // balance is now 12000.0000
If you change rounder to a value of -2, the function rounds balance to two decimal places:
balance = 12345.6789; rounder = -2; balance = mathLib.round(balance, rounder); // balance is now 12345.68