Let's say 6 is NumberRequiredItems based off some other calculation. I don't want to give out the whole thing, just want to do this round off function

I want to do specific rounding off:

If within 6, round down to multiple of 24 (min of 24), otherwise round up
to multiple of 24.

I get I would do 24\*Math.round(NumberRequiredItems), how do I do "Within 6" though? 

e.g IF something like 56, go up to 72 items. If 54, go down to 48, etc.

I know it seems a little tricky, but I would love the help. It may even help you.