From Delphi 11 onwards, digit separators _ can be used to split numeric literals
into groups.
To improve readability, this rule verifies that numeric literals using separators have groups of a standard, homogeneous size.
const
WrongGroupSize = 1_0000; // Noncompliant; using groups of 4 instead of 3
MixedGroupSize = $F_7F_FFFF; // Noncompliant; using mixed group sizes
Compliant code example
const
DecimalInt = 10_000;
HexadecimalInt2 = $7_FF_FF;
HexadecimalInt4 = $7_FFFF;
BinaryInt2 = %0_10_10;
BinaryInt3 = %01_010;
BinaryInt4 = %0_1010;
LongDecimalFloat = 10_000.0;
FloatWithAnySeps = 10.0_0_00_1;
Only the integer component of floating point numbers is checked for compliance; the fractional and exponent parts are ignored.
_ between groups.