How can I get a specific part of a text?

I want to get a text that is written for example “20k”, and in a script get 20000, that is, I want the script to recognize the k as 3 zeros.

1 Like

Then do it.

print((("20k"):gsub("k", "000"))) -- 20000

whenever i use (: gsub) can i replace the first argument with the second?

That is precisely what it does. It also returns how many replacements were made, but I wrapped the call in parentheses which is why only one result was shown

that’s exactly what I was looking for Thanks: D