Can someone help me? I need to convert a number for a maping that gives me a number in that format 0.2 then I need to convert it to a format like that 0,2. Thankful Nickzus.
local num = 0.2 local com = tostring(num) for i = 1,#com do com = com:gsub(".",",") end
First up you have to convert your number to a string, then You put a loop to the amount of the converted number. This is so that it switches any "." to "," with the gsub (will explain in a second)
Gsub switches a to b in a string and returns the finished value example:
String = "Hey world!" print(String:gsub("Hey","Hello"))
Output: Hello world!
That should work if I understand what you mean.. You can't convert it into a number as 0,2 since that's not a valid number. If this is not what you mean please leave a comment and tell me.