How to map freight weight without mixing units or mass types
A value like 1.25 means little without its unit and mass type. Preserve what was measured, what it refers to and how it was converted. A correct conversion can still put the wrong fact into the target field.
Store the value, unit, mass type and scope together.
UNECE Recommendation 20 provides standard codes for units, including those used for mass. Pin the code-list version your receiving contract expects. Translate a source code only when you can identify its meaning. Then confirm whether the target wants gross mass, net mass or another defined measure, and whether it applies to an item, consignment or load.
Resolve ambiguity before applying arithmetic.
| Source value | Expected mapping decision |
|---|---|
| 1.25 TNE gross mass | Convert to 1,250 KGM when the target expects kilograms, retaining the original value and unit. |
| 1.25 with no unit | Review unless the source contract unambiguously fixes the unit. |
| 1,250 KGM net mass | Do not copy into a gross-mass target just because the unit matches. |
| Individual package values and a shipment total | Do not add the total again. Verify which measurements are additive and apply the documented rounding rule. |
Keep precision and round only where the contract requires it.
Test a decimal conversion, an unsupported code, a mass-type mismatch and a near-boundary value. Parse decimal separators according to the source contract and avoid rounding each line before summing unless that is the specified rule. Keep the original value and conversion version so a later discrepancy can be reconciled.