title: Large numbers messing up?
body: <p>Sorry about the bad title, I couldn't think of anything better. So I was making a function to shorten numbers(1000 to 1k) and here it is.</p>
  
  <pre><code>local letters = {
  "K",
  "M", --I'm too lazy to put more
  "B",
  "QD",
  "QN",
  }
  local nums = {}
  
  for q=1,#letters do
      local dig = (q*3)+1
      local letter = 1*(10^(dig-1))
      table.insert(nums,#nums+1,letter)
  end
  
  
  function shorten(num)
  local len = tostring(num):len()
  print(len)
  if len&gt;=4 then
      for q=1,#letters do
          local dig = (q*3)+1 --digits the letter is
          if len &lt;= dig+2 then
              local toDo = math.floor(num/nums[q])
              print(nums[q])
              local newNum = toDo..letters[q]
              return newNum
              end
          end
      end
  end
  
  print(shorten(178900000000000))
  </code></pre>
  
  <p>And this prints.</p>
  
  <pre><code>10 --the length, and the real length of it is 15
  1000000000 --the one to divide it
  178900B --shortened num
  </code></pre>
  
  <p>I take one zero off of the print(shorten()) and it works fine. And I'm assuming the numbers are too big, or maybe there's a problem with the code. Thank you for reading this.</p>