Comparar precios por unidad
unit-price-compareOrdena ofertas por precio por unidad (kg, litro o unidad), convirtiendo g/kg/lb/oz y ml/l/fl_oz. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: aplicar descuentos porcentuales o fijos a un precio (discount-calculate). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Ranks product offers by price per unit (per kg, per liter or per item), converting g/kg/lb/oz and ml/l/fl_oz, to find the best value. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: applying percentage or fixed discounts to a price (discount-calculate). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offers | Yes | Offers (array of object; required; at least 1 items; up to 500 items). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| best | No | ||
| ranking | No |