MeridianMERIDIAN

Weight

identity.person.weight

Person weight in kg, lbs, or other units (e.g., 75kg, 165lbs). Transforms to DOUBLE (kilograms). Decompose extracts value and unit.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs DOUBLEunitvalue
75 kg75.0KG75.0
165 lbs74.84283005688056LBS165.0
68.5 kg68.5KG68.5
170 pounds77.11079460405875POUNDS170.0

Shape

Pattern
^[0-9]+(\.[0-9]+)?\s*(kg|lbs|lb|g|oz|stones)?$
ValueLengthShape
75 kg5matches
165 lbs7matches
68.5 kg7matches
170 pounds10rejected
75 k4rejected: one character short

Told apart

Going the other way, this type's own rule accepts 1 of 4 samples of Gender Code.

Background

Origin

Before 2019 the kilogram was tied to a physical object, the International Prototype Kilogram.[1]

The international yard and pound were agreed by representatives of six nations on 1 July 1959.[2] The signatories were Australia, Canada, New Zealand, South Africa, the United Kingdom and the United States.[2] The agreement defined the international pound as 0.45359237 kilograms.[2] The United States National Bureau of Standards adopted the metric-based units effective 1 July 1959.[2]

The stone is equal to 14 avoirdupois pounds.[3] The stone continues in customary use in the United Kingdom and Ireland for body weight.[3]

Use

NIST's Guide to the SI gives lb as the symbol for the avoirdupois pound and oz for the avoirdupois ounce.[4] A number with no unit is the hardest case: decide the unit from the source system's documentation, not from the size of the value, because a heavy adult in kilograms and a light adult in pounds overlap. (Meridian's view)

In the UK and Ireland a body weight may be given in stones and pounds, as in 11 stone 4, meaning 11 stones and 4 pounds.[3] A value like 11 stone 4 is two numbers in one field, so split it and convert both parts rather than reading only the leading number. (Meridian's view)

The NHANES 2017-2018 body measures file sets weight to missing for participants with limb amputations.[5] The same file carries a comment code for weights taken while the participant kept their own clothing on.[5] Look for companion flags like these before you analyse weights, because a measured weight and a usable weight are not always the same thing. (Meridian's view) Convert everything to kilograms once, keep the original text alongside it, and range-check the result so a mislabelled unit shows up as an outlier. (Meridian's view)

Where you'll meet it

The CDC's NHANES 2017-2018 body measures file records weight in the variable BMXWT, labelled Weight (kg).[5] In that file the observed weights run from 3.2 to 242.6 kg.[5]

Detection notes

v1 migration: Was person.weight. Transform converts to kilograms. Handles kg, lbs, pounds, stones. Decompose extracts value and unit.

Use it

CLI · DuckDB
$ finetype infer -i "75 kg" --mode column
→ identity.person.weight

SELECT ft_infer('75 kg');
-- → 'identity.person.weight'
Cast expression
CASE
  WHEN UPPER({col}) LIKE '%LB%' OR UPPER({col}) LIKE '%POUND%' THEN CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)', 1) AS DOUBLE) / 2.20462
  ELSE CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)', 1) AS DOUBLE)
END

Schema

https://meridian.online/schemas/identity.person.weight · Frictionless type number

finetype taxonomy identity.person.weight -o json-schema

Type Registry