I am making a text label show the amount of cash they have, with the commas. I used
to show the amount of cash and it works perfectly fine, but, it errors at the “%1,” and says “invalid capture index”. Is there any reason for this or ways to fix it?
Captures require enclosing parentheses.
Thank you, I never knew that they required parentheses as I don’t use gsub much.
Yeah, it’s quite a niche convention of “:gsub()” but it’s intuitive, suppose you wanted to do the following.
No, I wanted to leave the numbers and have 1 comma at the end, which is already working with just
I know what you were trying to do, the above was just a demonstration of why string captures work in that way.
Oh, sorry, misinterpreted that but that seems quite confusing and honestly I’m trying to understand why/how they work like that, never thought string formats would be so confusing