Change by function math utility function to change a number by number and set minimum and maximum limits for the result. Also has a cycle boolean attribute to determine whether the number should wrap around the limits - Example if
number 2
change by -2
min 1
max 10
then the result will be 9
Number
Change by
Min
max
Cycle (if yes/ true then wraps around - meaning if
number 2
change by -2
min 1
max 10
then the result will be 9
Download view src of this file including the change by function changeBy source code