I have a number and need to add a decimal to it for formatting.
The number is guaranteed to be between 1000 and 999999 (I have covered the other possibilities in other ways, this is the one I can’t get my head around). I need to put a decimal before the last 3 digits, for example:
1000 -> 1.000
23513 -> 23.513
999999 -> 999.999
How can I do this?
That says: Take a block of 3 digits (that must be anchored at the END of the string) and replace them with a “
.” followed by whatever was just matched.