calculate_grocery_unit_comparison
Compare unit prices of grocery items by normalizing quantities to standard units (kg, L). Identifies the best value and savings versus the priciest option.
Instructions
Compare unit prices of grocery items — normalizes g→kg, mL/cL→L. Returns: {best_value, savings_vs_priciest}. See list_bundles for related 'vie-quotidienne' calculators.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Items: name, price, quantity, unit (kg/g/L/mL/cl/unit) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | Computed result. Object whose fields depend on the tool (e.g. {tax, marginal_rate, brackets} for tax tools, {volume_l, gallons} for volume tools). | |
| formula | No | Human-readable formula or method used (e.g. "I=P·r·t", "Magnus formula"). | |
| source | No | Authoritative source for the rule or formula (e.g. "Article 197 CGI", "NF DTU 21"). | |
| reference_url | No | Link to a calcul2 page documenting the calculation in detail. |