C
C#15mo ago
Pokey

✅ 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 certain
5 Replies
canton7
canton715mo ago
Math.Floor(13/5) and 13 % 5
Pokey
Pokey15mo ago
Alrighty, thank you muchly
canton7
canton715mo ago
(Or 13 - Math.Floor(13/5) if you prefer... But that's just a long-winded way of saying the same thing)
Pokey
Pokey15mo ago
Ye
Accord
Accord15mo ago
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.