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

Products with 1/2 and 1/4 is added as 2 and 4 #544

Closed
odin-h opened this issue Apr 18, 2024 · 2 comments
Closed

Products with 1/2 and 1/4 is added as 2 and 4 #544

odin-h opened this issue Apr 18, 2024 · 2 comments
Labels
🙅‍♀️ Wontfix This will not be worked on

Comments

@odin-h
Copy link
Collaborator

odin-h commented Apr 18, 2024

What

Stuff like one half and one 4th L/KG is not converted correctly. Only the last digit after the slash is kept.
Here are two examples of 0,5L cartons of chocolate milk with the quantity written as 1/2L https://prices.openfoodfacts.org/app/products/7038010002625
https://prices.openfoodfacts.org/app/products/7038010066191

Steps to reproduce the behavior:

  1. Add a product with 1/2 unit of measurement

Expected behavior

Would be that fractions got converted to floats.

Platform (Desktop, Mobile, Hunger Games)

  • Platform Desktop
@raphodn
Copy link
Member

raphodn commented Apr 18, 2024

Hi @odin-h , this is a more of a problem on the openfoodfacts-server side.
Open Prices syncs with the OFF databases every day, and we store a subset of each product field.

Indeed, for 7038010002625 the data is incorrect : https://world.openfoodfacts.org/api/v2/product/7038010002625.json

"product_quantity": "2000",
"quantity": "1/2 L",

This was the issue - openfoodfacts/open-prices#115 - where we introduced product quantity, there's a link to the implementation in the openfoodfacts-server, maybe let them know there ? and/or on Slack ?

@raphodn raphodn added the 🙅‍♀️ Wontfix This will not be worked on label Apr 18, 2024
@raphodn
Copy link
Member

raphodn commented Apr 18, 2024

the quick fix is to edit the product quantity field directly in OFF, it doesn't seem to parse correctly the 1/X, better to change to 0,5 or 0,25 👍

@raphodn raphodn closed this as completed Apr 18, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in 💸 Open Prices Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅‍♀️ Wontfix This will not be worked on
Projects
Archived in project
Development

No branches or pull requests

2 participants