BigDecimal may be a better solution here (or perhaps another solution not yet thought of?)
Anyways, this should fix all cases of off-by-one regardless, it's just possible there are other issues this could introduce that I'm not thinking of right now.
Updated with commit to use BigDecimal instead. Assuming I didn't typo anything, this should be a 100% safe change 🤞 unlike round which could have complications.
BigDecimal
may be a better solution here (or perhaps another solution not yet thought of?)Anyways, this should fix all cases of off-by-one regardless, it's just possible there are other issues this could introduce that I'm not thinking of right now.