✅ Obtain % Modulus divisor?
Quick mafs: I have a
decimal
type variable which will always be a whole number. I also have a list of objects which have a quantity field on them.
I would like to spread the decimal variable out evenly across each object in the list, and then whatever whole number remainder I have left I will deal with separately.
So if I have a value of 13, and I have 5 objects, I am not sure what calculations I need to do to end up with a value of 2 (per object) remainder 3.
Pretty sure I need to mod it in some way but not certain5 Replies
Math.Floor(13/5) and 13 % 5
Alrighty, thank you muchly
(Or 13 - Math.Floor(13/5) if you prefer... But that's just a long-winded way of saying the same thing)
Ye
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.