function separator(text) -- by Royan_Millans
if text:find("$") then
for S in string.gmatch(text, "%$%d+") do
local replace = comma_value(S)
text = string.gsub(text, S, replace, 1)
end
for S in string.gmatch(text, "%$%s%d+") do
local replace = comma_value(S)
text = string.gsub(text, S, replace, 1)
end
for S in string.gmatch(text, "%d+%$") do
S = string.sub(S, 0, #S-1)
local replace = comma_value(S)
text = string.gsub(text, S, replace, 1)
end
end
return text
end