Maybe I'm misunderstanding but:
Lua Code:
local function ReadableNumber(num)
local ret
local placeValue = ("%%.%df"):format(2) --probably can be improved into "%.0f"
if not num then
return "0 "
elseif num >= 1000000000000 then
ret = placeValue:format(num / 1000000000000) .. " Tril" -- trillion
elseif num >= 1000000000 then
ret = placeValue:format(num / 1000000000) .. " Bil" -- billion
elseif num >= 1000000 then
ret = placeValue:format(num / 1000000) .. " Mil"-- million
elseif num >= 1000 then
ret = placeValue:format(num / 1000) .. "k" -- thousand
else
ret = num .. " "-- hundreds
end
return ret
end