# Numeric Code

Key: `representation.identifier.numeric_code`

All-digit string where the digit pattern is meaningful and leading zeros must be preserved. Covers ISO country numeric codes (840, 036), FIPS codes, product category codes, and similar classification systems. The critical property is that these values MUST remain as VARCHAR — casting to integer strips leading zeros and destroys the code's identity. Defers to geography.address.postal\_code and identity.person.phone\_number when those more specific types apply, and to the identity.industry.\* leaves (identity.industry.naics) for industry classification codes.

Page: <https://meridian.online/docs/projects/finetype/types/representation/identifier/numeric_code>

Samples: `840`, `036`, `06`, `06075`, `0001`, `99`

## Background

### Origin

Numeric Code is a type FineType defines itself, for an all-digit string whose digit pattern is meaningful and whose leading zeros must be preserved.[[1]](https://github.com/meridian-online/finetype/blob/main/labels/definitions_representation.yaml) FineType's registry names ISO country numeric codes, FIPS codes and product category codes among the classification systems the type covers.[[1]](https://github.com/meridian-online/finetype/blob/main/labels/definitions_representation.yaml) FineType's registry notes that the type was added in version 0.5.2 to address leading zeros being stripped when numeric-looking codes are inferred as integers.[[1]](https://github.com/meridian-online/finetype/blob/main/labels/definitions_representation.yaml) The type is less a single standard than a family resemblance: codes written in digits, where the digits are labels rather than quantities. (Meridian's view)

ISO 3166-1 numeric codes are three-digit country codes defined in ISO 3166-1.[[2]](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) The ISO 3166-1 numeric codes originate in the three-digit country codes of the United Nations Statistics Division's M49 standard.[[2]](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) The United Nations publication Standard Country or Area Codes for Statistical Use was originally published as Series M, No. 49 and is now commonly referred to as the M49 standard.[[3]](https://unstats.un.org/unsd/methodology/m49/) The ISO 3166-1 numeric codes were first included in ISO 3166 in its second edition in 1981.[[2]](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) Wikipedia's article on ISO 3166-1 numeric gives script independence as an advantage of numeric codes over alphabetic ones.[[2]](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)

The US Census Bureau says that INCITS codes were formerly known as Federal Information Processing Standards (FIPS) codes.[[4]](https://www.census.gov/library/reference/code-lists/ansi.html) The Census Bureau's state code list gives California the FIPS state numeric code 06.[[5]](https://www.census.gov/library/reference/code-lists/ansi/ansi-codes-for-states.html)

### Use

Microsoft's support pages say Excel automatically removes leading zeros so that formulas and math operations can work on the values.[[6]](https://support.microsoft.com/en-us/office/keeping-leading-zeros-and-large-numbers-1bf7b935-36e1-4985-842f-5dfa51f85fe7) Microsoft recommends using Excel's Get \& Transform (Power Query) to format individual columns as text when importing data.[[6]](https://support.microsoft.com/en-us/office/keeping-leading-zeros-and-large-numbers-1bf7b935-36e1-4985-842f-5dfa51f85fe7) The pandas documentation for read\_csv says to use str or object for dtype, together with suitable na\_values settings, to preserve values and not interpret their dtype.[[7]](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html) DuckDB's read\_csv has an all\_varchar option that skips type detection and treats every column as VARCHAR.[[8]](https://duckdb.org/docs/current/data/csv/overview.html) DuckDB's CSV reader also accepts a types option that sets column types by position or by name.[[8]](https://duckdb.org/docs/current/data/csv/overview.html)

The safest habit is to read any column of codes as text from the first step, and to treat a mix of lengths in a column that should be fixed-width as a sign that something upstream has already cast it to a number. (Meridian's view) Re-padding with zeros is only a repair when the code's fixed width is known, as with three-digit country codes; for codes of varying width it can invent values that never existed. (Meridian's view)

### Where you'll meet it

The UN Statistics Division's M49 list gives three-digit numerical codes used for statistical processing by the Statistics Division of the United Nations Secretariat.[[3]](https://unstats.un.org/unsd/methodology/m49/)

## Sources

1. [finetype/labels/definitions\_representation.yaml at main · meridian-online/finetype](https://github.com/meridian-online/finetype/blob/main/labels/definitions_representation.yaml) — FineType
2. [ISO 3166-1 numeric - Wikipedia](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) — secondary source
3. [UNSD — Methodology](https://unstats.un.org/unsd/methodology/m49/) — organisation
4. [American National Standards Institute (ANSI) Codes](https://www.census.gov/library/reference/code-lists/ansi.html) — documentation
5. [American National Standards Institute (ANSI) Codes for States](https://www.census.gov/library/reference/code-lists/ansi/ansi-codes-for-states.html) — organisation
6. [Keeping leading zeros and large numbers - Microsoft Support](https://support.microsoft.com/en-us/office/keeping-leading-zeros-and-large-numbers-1bf7b935-36e1-4985-842f-5dfa51f85fe7) — documentation
7. [pandas.read\_csv — pandas documentation](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html) — documentation
8. [CSV Import – DuckDB](https://duckdb.org/docs/current/data/csv/overview.html) — documentation
