Suppliers send measurement data in different units — one uses grams, another kilograms, a third uses pounds. FeedPrep's measurement normalization converts all values to your preferred target unit automatically using a two-step process.
Step 1: Unit Extraction
Before any conversion can happen, FeedPrep needs to separate the numeric value from its unit. The unit extraction step parses raw strings and breaks them into structured components.
Examples of parsed values:
| Raw String | Extracted Value | Extracted Unit |
|---|---|---|
1850g | 1850 | g |
1.85 kg | 1.85 | kg |
40 cm | 40 | cm |
15.7 inches | 15.7 | inches |
500ml | 500 | ml |
The parser uses pattern matching to identify a number followed by optional whitespace and a unit abbreviation. It handles integers, decimals, and common formatting variations.
Step 2: Measurement Normalization
Once a value and unit are extracted, FeedPrep converts the value to the target unit defined for that attribute. The target unit is specified either in the attribute definition in your schema or via normalization rules.
| Input | Target Unit | Converted Output |
|---|---|---|
| 1850 g | kg | 1.85 kg |
| 40 cm | mm | 400 mm |
| 15.7 inches | mm | 399 mm |
| 5.5 lbs | kg | 2.49 kg |
| 500 ml | l | 0.5 l |
Supported Unit Families
FeedPrep supports conversion across the following unit families:
Length
mm, cm, m, km, in, inch, inches, ft
Weight
g, kg, lb, lbs, oz
Volume
ml, cl, l
Conversions only work within the same family — you can convert grams to kilograms, but not grams to centimeters.
Target Unit Configuration
The target unit for each measurement attribute can be defined in two places:
- Attribute definition — Set a default target unit directly on the attribute in your schema. This applies to all feeds and suppliers.
- Normalization rules — Override the target unit for specific suppliers or scenarios using transform rules.
Export Flexibility
After conversion, the numeric value and unit are stored separately. This gives you flexibility at export time:
- Combined — Export as a single string (e.g.,
400 mm). - Split — Export the value and unit in separate columns (e.g.,
400in one column,mmin another).
This is especially useful when integrating with PIM systems or marketplaces that expect value and unit in separate fields.