C
C#2y 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
canton72y ago
Math.Floor(13/5) and 13 % 5
Pokey
PokeyOP2y ago
Alrighty, thank you muchly
canton7
canton72y ago
(Or 13 - Math.Floor(13/5) if you prefer... But that's just a long-winded way of saying the same thing)
Pokey
PokeyOP2y ago
Ye
Accord
Accord2y 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.
Want results from more Discord servers?
Add your server