3,543
edits
(→Generic approach: updated) |
|||
Line 28: | Line 28: | ||
=== Generic approach === | === Generic approach === | ||
The real-world quantities for products as used by the users us a far from ideal. However it is possible to find some common approach. (At least we try here) | The real-world quantities for products as used by the users us a far from ideal. However it is possible to find some common approach. (At least we try here) | ||
* to indicate times, either a "*" or a "x" | * to indicate times, either a "*" or a "x" can be used; | ||
* the generic formula is: multiplier * quantity size_unit for units | * the generic formula is: multiplier * quantity size_unit for units | ||
* multiple formulas are distinguished by a ";" | |||
** multiplier indicates how often a quantity unit is used, i.e. 6 (25 cl bottles). This is a number. | ** multiplier indicates how often a quantity unit is used, i.e. 6 (25 cl bottles). This is a number. | ||
** quantity the size of the units in size_units, i.e. 25 (size) cl (size_unit) bottles (units). This is a number. | ** quantity the size of the units in size_units, i.e. 25 (size) cl (size_unit) bottles (units). This is a number. | ||
** size_units is the unit for the size parameter, i.e. kg, ml or cl. This is an enumerated? | ** size_units is the unit for the size parameter, i.e. kg, ml or cl. This is an enumerated? | ||
** unit is the element the numbers and sizes refer to, i.e. pot, bottle, sack, etc. | ** unit is the element the numbers and sizes refer to, i.e. pot, bottle, sack, etc. | ||
Some remarks: | |||
* not all 4 elements are always specified, eg 250 g means 1*250 g for the entire product | * not all 4 elements are always specified, eg 250 g means 1*250 g for the entire product | ||
* sometimes more than one quantity is specified, e.g. 250 g (5x50 g) might mean 1x250g for the entire product OR 5 50g pots | * sometimes more than one quantity is specified, e.g. 250 g (5x50 g) might mean 1x250g for the entire product OR 5 50g pots | ||
* there are exceptions, such as multiple multipliers. | * there are exceptions, such as multiple multipliers. | ||
* naturally users do not use this formal approach, but most quantities can be translated to this approach. | |||
Test: | |||
== Countries == | == Countries == |
edits