Skip to content

Decimals in source quantity are not used for price-per quantity #1104

@Freso

Description

@Freso

What

For products with a quantity with decimal values (e.g., “8.6 g”), Prices will drop the decimals (not even attempt to round), and will not include them in “price per quantity” calculations, leading those to be wrong.

Steps to reproduce the behavior:

  1. Go to https://prices.openfoodfacts.org/products/8720289261542
  2. Note the quantity is shown as “8 g” when the product on OBF is “8.6 g”
  3. Note the calculated price-per-quantity is “SEK 1,250.00 / kg” rather than “SEK 1,162.79 / kg”.

Expected behavior

I expected the price-per-quantity to be based on the actual known quantity rather than an approximation of it.

Part of

Metadata

Metadata

Assignees

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions