Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function split(x)
- local tab = {}
- for i=1,#x do
- local num = string.sub(x,i,i)
- for k=1,#x-i do
- num = num.."0"
- end
- if tonumber(num) ~= 0 then
- -- if num ~= "50" and num ~= "5" and num ~= "500" then
- local numberofzeros = #num-1
- for i=1,tonumber(string.sub(num,1,1)) do
- local newnum = 1
- for i=1,numberofzeros do
- newnum = newnum.."0"
- end
- table.insert(tab,newnum)
- end
- -- end
- end
- end
- return tab
- end
- local a = ""
- local k = split("396")
- for i=1,#k do
- if i ~= #k then
- a = a..k[i].."+"
- else
- a = a..k[i]
- end
- end
- print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement