Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- superscript generator (for numbers)
- function to_super(x)
- local function number_to_super(x)
- local y = tonumber(x)
- if y ~= nil then
- local tab = {"¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"}
- if tab[y] ~= nil then
- return tab[y]
- else
- return "⁰"
- end
- end
- end
- local y = tostring(x)
- local str = ""
- for i=1,#y do
- str = str..number_to_super(string.sub(y,i,i))
- end
- return str
- end
- print(to_super(81072))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement