openfoodfacts-server
openfoodfacts-server copied to clipboard
Rounding question on the average Nutri-Score of white rice (B vs. A)
What
- I looked at the category white rices and saw that the average nutriscore value was -0.71. This is however rounded to Nutri-Score B.
- I would expect Nutri-Score A, with rounding to -1 or for all negative raw values.
Part of
- #5517
That seems to be correct, according to the specs: https://github.com/openfoodfacts/openfoodfacts-server/blob/25d4175330f9fadbba8bc80ec0afea358a9b4c3d/lib/ProductOpener/Food.pm#L4397-L4421
It could be interpreted either way. -0.71 is above -1 (and thus not A) and less than 0 (and thus not B). As it is an average score, I guess we could round the score to the nearest integer. Or keep the current behaviour.
Is it fixed by the recode ? @stephanegigandet