Skip to content

Height

Type Registry

Height

identity.person.height

Person height in cm, inches, or feet.inches format (e.g., 180cm, 5'10", 180). Transforms to DOUBLE (centimeters). Decompose extracts value and unit.

Domain identityperson
Casts to DOUBLE
Scope Universal

Try it

CLI
$ finetype infer -i "180 cm"
→ identity.person.height

DuckDB

Detect
SELECT finetype('180 cm');
-- → 'identity.person.height'
Cast expression
CASE
  WHEN UPPER({col}) LIKE '%FT%' OR {col} LIKE '%\\''%' THEN
    (CAST(REGEXP_EXTRACT({col}, '^([0-9]+)') AS DOUBLE) * 30.48) +
    (CAST(COALESCE(REGEXP_EXTRACT({col}, '\\'([0-9]+)'), '0') AS DOUBLE) * 2.54)
  WHEN UPPER({col}) LIKE '%IN%' THEN CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)') AS DOUBLE) * 2.54
  ELSE CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)') AS DOUBLE)
END
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS DOUBLE) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'identity.person.height';

Struct Expansion

unit: UPPER(COALESCE(REGEXP_EXTRACT({col}, '([A-Z]+)$'), CASE WHEN LENGTH({col}) > 10 THEN 'CM' ELSE 'INCH' END))
value: CAST(REGEXP_EXTRACT({col}, '^([0-9.]+)') AS DOUBLE)

JSON Schema

finetype schema identity.person.height
{
  "$id": "https://noon.sh/schemas/identity.person.height",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Person height in cm, inches, or feet.inches format (e.g., 180cm, 5'10\", 180). Transforms to DOUBLE (centimeters). Decompose extracts value and unit.",
  "examples": [
    "180 cm",
    "5'10\"",
    "70 inches",
    "6 ft"
  ],
  "pattern": "^[0-9]+(\\.[0-9]+)?\\s*(cm|in|ft|inches|feet)?$|^[0-9]+'[0-9]+\"$",
  "title": "Height",
  "type": "string"
}

Examples

180 cm5'10"70 inches6 ft

Types in identity