I'm saving the monthly forecasted values in postgesDB matching with actual result using python eg monthly forecasted values [10.5, 20.6, 30.8, 5.4, 0, 1, 1.4, 2.2] which sums 71.9 and actual result 65
my solution is to get a rescale factor by dividing actual to forecasted sum 65 / 71.9 = 0.904 and multiply that to all values in forecasted values now new list will be [9.492, 18.622, 27.843, 4.881, 0, 0.904, 1.265, 1.988] which sums to 64.995 and rounded to 65 the actual value, but now I was asked to forecasted values can only be integers, what is the best way to refactor the list to have the forecasted values as only "positive integers" and be close to actual result by +-1. I tried rounding the list values after refactor but for list large records the difference to actual value is more that 100