Large numeric values are difficult to assign to strings due to intermediary coercions, I have not been able to find a way to properly represent a long numeric string literal. Consider representing a phone number, 5551234567, as a string.
5551234567 »»» (integer) 1256267271
'5551234567'»»» (integer) 1256267271
The string is converted to an integer but the number is too large to represent as an integer. Decimals fare better:
5551234567. »»» (decimal) 5551234567
'5551234567.' »»» (decimal) 5551234567
This looks good, but when decimals are coerced to strings the number is transformed to E notation:
5551234567. + '' »»» (string) 5.551234567E9
The only types of solutions I’ve found are clumsy and require an expression:
sprintf('%.0f', 5551234567.)
string('555') + string('1234567')
replace('x5551234567', 'x', '')
Is there any way to make string literals, especially when defined in expressions with explicit quotes, not coerce as greedily?