MeridianMERIDIAN

Integer Number

representation.numeric.integer_number

Whole number without fractional part. String representation of an integer. Transforms to BIGINT or INTEGER depending on value range.

Try a value

Integer Number's rule accepts it.

Reads it as 42

Use it

Shell
finetype infer -i '42' --mode column
# → representation.numeric.integer_number
DuckDB
SELECT ft_infer('42');
-- → 'representation.numeric.integer_number'
Cast template: {col} is your column
CAST({col} AS BIGINT)
Casts to
BIGINT

Pattern

Regular expression
^-?[0-9]+$
ValueLengthShape
422matches
-173matches
01matches
9999999999matches

Similar types

2 of the 5 other numeric types accept every one of these samples on shape alone.

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

In Meridian's datasets

Background

Origin

In computer science, an integer is a datum of integral data type, a data type that represents some range of mathematical integers.[1] In programming-language source code, an integer literal is commonly written as a sequence of digits optionally prefixed with + or −.[1]

W3C's XML Schema 1.1 Part 2 defines integer as derived from decimal by fixing the value of fractionDigits to be 0 and disallowing the trailing decimal point.[2] XML Schema 1.1 gives integer a lexical representation of a finite-length sequence of one or more decimal digits with an optional leading sign.[2] XML Schema 1.1 bounds its long datatype at a minInclusive of -9223372036854775808 and a maxInclusive of 9223372036854775807.[2] RFC 8259, the JSON specification, does not allow leading zeros in a number.[3] The Frictionless Data Table Schema describes its integer field type as containing integers, that is whole numbers.[4]

Use

DuckDB's BIGINT type, also called INT8, INT64 or LONG, holds values from -2^63 to 2^63 - 1 in 8 bytes.[5] DuckDB's INTEGER type, also called INT4, INT32, INT or SIGNED, holds values from -2^31 to 2^31 - 1 in 4 bytes.[5] DuckDB's HUGEINT type, also called INT128, holds values from -2^127 to 2^127 - 1.[5]

RFC 8259 notes that integers in the range [-(2**53)+1, (2**53)-1] are interoperable between JSON implementations.[3] JavaScript's Number.MAX_SAFE_INTEGER is 9007199254740991.[6] Microsoft's support article says Excel has a maximum precision of 15 significant digits.[7] Microsoft's support article says that in Excel any numbers past the 15th digit are rounded down to zero.[7] When a long run of digits arrives from a JSON API or a spreadsheet export, compare it against the original before trusting the last few digits. (Meridian's view)

Microsoft's support article says Excel automatically removes leading zeros.[7] A prefix 0 is used in C to specify string representations of octal numbers.[8] A leading zero can be a distinguishing character rather than part of a value, as in telephone numbers.[8] Before casting a column of digits to an integer, ask whether it is a quantity you would add up or a code you would look up; codes such as postal codes, account numbers and identifiers are better kept as text. (Meridian's view)

How it's detected

Converts to BIGINT. Includes negative numbers. Pattern is simple integer format.

Schema

https://meridian.online/schemas/representation.numeric.integer_number · Frictionless type integer

finetype taxonomy representation.numeric.integer_number -o json-schema

Aliases

integerwhole_number

Type Registry