I have a JSONEncoded table that looks like this:
ImgScript = '["27.83","301.2","27.3","301.15","302.1","301.4","27.26","301.1","27.19","301.1","27.18","301.9","27.3", etc...]'
Now, don't let those numbers fool you! 27.83 actually means 27 to the power of 83, or 27^83. I can't use a ^ symbol or else JSONDecode won't work. This string is really long, so I want to shorten it. To shorten it, I did the following:
ImgScript = string.gsub(ImgScript, '"', '')
ImgScript = string.gsub(ImgScript, '.1,', ',')
So the first line basically removes all of the "quotation" marks. The second line is supposed to replace all the numbers that are to the power of 1, because that is redundant, with the number itself. So 301.1 would become 301.
This worked at first, but some sort of change I made broke the script. Instead of replacing all of the .1, with ,, some of them are replaced with ., which then gives me an error "Can't Parse JSON" when I try to JSONDecode.
So why does my second line of code replace .1, with ., instead of ,?

1 comment
Maybe there is something wrong with the script. Just a educated guess.