MathLib.round rounds a value and returns the result.
eglx.lang
static function round(val1 float in, powOf10 int in) returns (float); static function round(val1 smallfloat in, powOf10 int in) returns (smallfloat); static function round(val1 decimal in, powOf10 int in) returns (decimal);
The next code sets balance to 12000.0000:
balance FLOAT = 12345.6789; rounder INT = 3; balance = mathLib.round(balance, rounder);
balance FLOAT = 12845.6789; rounder INT = 3; balance = mathLib.round(balance, rounder);
balance FLOAT = 12345.6789; rounder INT = -2; balance = mathLib.round(balance, rounder);
In the case of Java™, EGL uses methods in the Java StrictMath class that are equivalent to the EGL functions. This usage ensures that the runtime behavior is the same for every Java Virtual Machine.
| Target | Issue |
|---|---|
| Java | No issues. |
| JavaScript | No issues. |