Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding question on the average Nutri-Score of white rice (B vs. A) #1860

Open
Tracked by #5517
aleene opened this issue Jun 3, 2019 · 3 comments
Open
Tracked by #5517

Rounding question on the average Nutri-Score of white rice (B vs. A) #1860

aleene opened this issue Jun 3, 2019 · 3 comments

Comments

@aleene
Copy link
Contributor

aleene commented Jun 3, 2019

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

@hangy
Copy link
Member

hangy commented Jun 4, 2019

That seems to be correct, according to the specs:

# New grades from HCSP avis 20150602 hcspa20150625_infoqualnutprodalim.pdf
# Tableau 1 : Seuils du score FSA retenus pour le cas général
# Classe du 5-C
# Bornes du score FSA
# A/Vert Min - -1
# B/Jaune 0 – 2
# C/Orange 3 – 10
# D/Rose 11 – 18
# E/Rouge 19 – Max
if ($fr_score <= -1) {
$grade = 'a';
}
elsif ($fr_score <= 2) {
$grade = 'b';
}
elsif ($fr_score <= 10) {
$grade = 'c';
}
elsif ($fr_score <= 18) {
$grade = 'd';
}
else {
$grade = 'e';
}

@hangy hangy added the 🚦Nutri-Score https://world.openfoodfacts.org/nutriscore label Jun 4, 2019
@stephanegigandet
Copy link
Contributor

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.

@teolemon
Copy link
Member

Is it fixed by the recode ? @stephanegigandet

@teolemon teolemon changed the title Average Nutri-Score Rounding question on the average Nutri-Score of white rice (B vs. A) Jan 15, 2024
@teolemon teolemon moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 23, 2024
@teolemon teolemon added 🚦 Nutri-Score and removed 🚦Nutri-Score https://world.openfoodfacts.org/nutriscore labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To discuss and validate
Status: No status
Development

No branches or pull requests

4 participants