Skip to content

Guide: units and conversion

When adding quantities of referenced ingredients together for the ingredients list (i.e the ingredients properties of a Recipe), the parser tries its best to add apples to apples.

  • If the quantities are defined in two different units of the same type and system, the largest unit is retained and the other quantity is converted. Example: 1%kg + 100%g will become 1.1%kg
  • If the quantities are defined in units of the same type but in different systems (e.g. volume and mass), they will be first converted to the metric unit
  • If the quantities are defined in incompatible units (e.g. text, or volume and mass), the quantities won't be added and a separate ingredient will be created in the list.

The following table of units and aliases is taken into account:

NameTypeSystemAliasesTo Base
gmassmetricgram, grams, grammes1
kgmassmetrickilogram, kilograms, kilo, kilos1000
ozmassimperialounce, ounces28.3495
lbmassimperialpound, pounds453.592
mlvolumemetricmilliliter, milliliters, millilitre, millilitres, cc1
clvolumemetriccentiliter, centiliters, centilitre, centilitres10
dlvolumemetricdeciliter, deciliters, decilitre, decilitres100
lvolumemetricliter, liters, litre, litres1000
tspvolumemetricteaspoon, teaspoons5
tbspvolumemetrictablespoon, tablespoons,15
fl-ozvolumeimperialfluid ounce, fluid ounces29.5735
cupvolumeimperialcups236.588
pintvolumeimperialpints473.176
quartvolumeimperialquarts946.353
gallonvolumeimperialgallons3785.41
piececountmetricpieces, pc1