EDIT : just saw there’s this issue for the particular problem of thousands separators, but I think the availability of
substring
may attract (or not) some votes if searched by others
Context
I have a column with numbers ranking from a thousand to billions, and I want to display them nicely (ie 1000
⇒ 1.000
, 1890000100
⇒ 1.890.000.100
).
Frustration
Currently, we have a left
and right
function to catch text from the beginning or the end of a text. But in order to obtain the result above we have to go through a lot of intermediary formulas in order to avoid a function mess.
However, when we want to extract a specific substring by indices, it is not possible.
Solution
Implement a substring
function which could work this way
substring(string: str, start: int, end: int) -> str
# Pythonic way
substring('naturally', 1, 4) = 'atu' # Python equivalent of 'naturally'[1:4]
# more-clear way
substring('naturally', 1, 4) = 'natu' # Python equivalent of 'naturally'[0:4]