FLT

Synopsis

HELP:   Float-detector hints: locale, NoInf/NaN, NoSci-notation, family
TYPE:   OBJECT
SYNTAX: FLT(LOCALE=AUTO/ISO/DE/US/ANSI/FR/CH,NOINFNAN,NOSCI,FAMILY=ALL/NONE/HFP/IEEE/DFP,FRASEP=SYSTEM/PERIOD/COMMA/APOSTROPHE,GRPSEP=NON/OFF/SYSTEM/PERIOD/COMMA/SPACE/APOSTROPHE,FRADIG=num)

Description

The FLT sub-object inside DETECT(HINTS(...)) carries float-detector filters that restrict the type detector at bit-setting time. All hints are optional; omitting them keeps the detector at its default, which sets every plausible float-subformat bit.

Locale

LOCALE narrows the locale set for float detection (steers the default decimal point and thousand separator). AUTO falls back to HINTS.LOCALE.

detect(hints(flt(locale=DE))) -- expect "1.234,56" (comma decimal) detect(hints(flt(locale=US))) -- expect "1,234.56" (dot decimal)

Special values

NOINFNAN suppresses the bit that allows the literal Inf / NaN strings during FLT detection. Use it when those strings would otherwise be misclassified as floats.

NOSCI suppresses scientific-notation bits. Use it when "1E5" or "1e-3" must NOT be auto-detected as float (e.g. when those tokens are valid identifiers in the source data).

detect(hints(flt(noinfnan=YES nosci=YES)))

Float family

FAMILY restricts which floating-point families DETFIX probes. Bitmask: combine values to allow several families.

detect(hints(flt(family=HFP))) -- IBM Hexadecimal Float (z/OS COMP-1/COMP-2) only detect(hints(flt(family=IEEE))) -- IEEE 754 binary float (open-world) only detect(hints(flt(family=DFP))) -- IEEE 754 Decimal Float (DFP64/DFP128) only detect(hints(flt(family=NONE))) -- skip float probing entirely

Decimal-string separator filters

FRASEP, GRPSEP and FRADIG restrict which DEC-family bits the string-form float detector may set. They mirror the INT-side counterparts and share the DIGIT_SEPARATOR selection.

All three hints are subtractive: the raw detector first sets every plausible DEC-family bit; the hint then masks the result down to the user-allowed combinations. Hints can never add a bit that the raw detector would not have set on its own.

The hints affect only the DEC family (DOT_DEC_, COMMA_DEC_); bits outside that family (SCI, INF_NAN, HEX_FLOAT, PERCENTAGE, BIN_*) are left untouched and continue to follow NOINFNAN / NOSCI / FAMILY.

The filter chain runs in this order:

raw detect -> NOINFNAN / NOSCI -> FRASEP / GRPSEP -> FRADIG

Natural-pair inference: setting one of FRASEP / GRPSEP is enough. If only FRASEP is given, GRPSEP is inferred as the natural partner (PERIOD <-> COMMA); the same holds the other way round. Set both explicitly when an unusual combination is desired.

FRASEP=PERIOD -> GRPSEP inferred as COMMA (US/UK) FRASEP=COMMA -> GRPSEP inferred as PERIOD (DE) GRPSEP=PERIOD -> FRASEP inferred as COMMA (DE) GRPSEP=COMMA -> FRASEP inferred as PERIOD (US/UK)

GRPSEP semantics once FRASEP is fixed:

GRPSEP=SYSTEM (default) -- any natural thousand separator allowed GRPSEP=PERIOD/COMMA/... -- only that thousand separator allowed GRPSEP=OFF (or NON) -- forbid any thousand separator entirely; only the bare DOT_DEC_NO_THOUS or COMMA_DEC_NO_THOUS bit can survive

detect(hints(flt(frasep=PERIOD))) -- US/UK; "1,234.56" allowed, "1.234,56" rejected detect(hints(flt(grpsep=PERIOD))) -- DE via natural pair; "1.234,56" allowed detect(hints(flt(frasep=COMMA grpsep=OFF))) -- "1,5" only, no thousands ("1.234,56" rejected)

FRADIG pins the count of fractional digits after the decimal separator to exactly N (not at most N). Set to 2 for typical currency amounts; 0 disables the filter.

When FRADIG is set and the actual fraction-digit count differs, all DEC-family bits are cleared (the value is then no longer detected as a decimal float; SCI / HEX_FLOAT / etc. remain unaffected).

detect(hints(flt(frasep=PERIOD fradig=2))) -- "1.50" ok, "1.5" / "1.500" rejected

Arguments