Script Helper
CLC-002 Free Test before use
Benefit = salary multiple, rounded and capped
Life benefit equals a multiple of salary, rounded to the nearest $1,000, with a maximum.
Engine › On CalcEngineOnCalcBeginner
Test before use. This script hasn't been tested by Catalyst Workflow yet. Run it in a non-production case first.
JScript.NET
1// EngineOnCalc — 2x salary, nearest $1,000, max $500,0002var multiple = 2; // CHANGE3var cap = 500000; // CHANGE4var benefit = Math.round((Event.Employee.Salary * multiple) / 1000) * 1000;5// Use Math.ceil instead of Math.round to always round UP to the next $1,000.6if (benefit > cap) benefit = cap;7Event.BenefitAmount = benefit;Highlighted lines are marked CHANGE — swap in your own values before using.
How it works
Divide, round, multiply is the standard way to round to a step size.
Values to change
- multiple
- cap
- rounding direction
Cautions
- Config exposes MaxSalaryMultiplier / RoundFactor — configuration may cover this.