You can use a microflow expression, below is the complete expression I will explain what is does: You should have to integer or float variables, this can be separate microflow variables, an attribute or a static nr. This expression starts with converting the numbers to strings. Then the first 4 digits from both the numbers will be substracted. There will be 2 strings containing the 4 digits. if they are equal this expression returns true.
substring( toString($NrVar1), 0,4) = substring( toString($NrVar2), 0,4)
**Example:**
$NrVar1 = 123456789; $NrVar2 = 123498765;
substring( toString(123456789), 0,4) = substring( toString(123498765), 0,4) ;
substring( '123456789', 0,4) = substring( '123498765', 0,4) ;
'1234' = '1234' ;
true;