eniallator

Base Conversion

Aug 29th, 2016
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.17 KB | None | 0 0
  1. local function convert(num, base)
  2.   local outTbl = {}
  3.   while num > 0 do
  4.     table.insert(outTbl,num%base)
  5.     num = math.floor(num/base)
  6.   end
  7.   return outTbl
  8. end
Advertisement
Add Comment
Please, Sign In to add comment