in the THEN there is cint(in_Integer) -cint(in_Integer.ToString.Substring(in_Integer.ToString.Length-1))
in the ELSE there is cint(in_Integer) -cint(in_Integer.ToString.Substring(in_Integer.ToString.Length-1)) + 5
I’m struggling to follow these; is there a ‘simpler’ way to write the code or please can someone explain what is happening
I am not sure about your variable types, but I set up two variables as Decimal types, and have an assign activity like this:
variable2 = math.Round(variable1/5)*5
You can technically change both 5’s into any number and it should round to that number.
Again, be careful with the variable types here, and test it with your data.
EDIT:
Just saw that you want to round down for every value. Logic is still the same, but instead of math.round, use math.floor. You can also use math.Ceiling to round up.