Because this will usually be a non-integer, may also want to use `Math.round` or use `Math.floor`, depending on how that changes behavior. The given implementation here is probably simplest, though.