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

Quantities in "mg" are returned in "g" from the API. product_quantity type changes based on unit. #11346

Open
theedov opened this issue Feb 8, 2025 · 0 comments

Comments

@theedov
Copy link

theedov commented Feb 8, 2025

What

Few issues:

  • 9344962003855: "product_quantity" is 175mg but API returns 0.75 with "g" unit. Also there's an issue with "product_quantity" type, if it's in grams, the type is string("175"), but when it's mg, the type is number(0.75).
  • 9310653105610: Also for web it seems that salt is entered in "mg", but is shown in "g". While calcium is entered in "mg" and is correctly shown in "mg".

Expected behavior

If entered in MG, API should return MG value, etc...

Screenshot/Mockup/Before-After

Image Image Image

Type of device

REST-API

Number of products impacted

See at least 1.

@github-project-automation github-project-automation bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Feb 8, 2025
@theedov theedov changed the title Macros in "mg" are returned as "g" value from the API Quantities in "mg" are returned in "g" from the API. product_quantity type changes based on unit. Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To discuss and validate
Development

No branches or pull requests

1 participant