summaryrefslogtreecommitdiff
path: root/format.lua
blob: 67379a8d778445a5675b6c738faa8be3f1100ed5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local format = {}


function format.csv (tvalues)
	local str = string.format("%d", tvalues[1])
	for i=2, #tvalues do
		str = str .. string.format(",%d", tvalues[i])
	end
	return str
end


function format.float (float)
	return string.format("%.5f", float)
end


function format.ascii32 (tvalues)
	local str = ""
	for _, value in ipairs(tvalues) do
		str = str .. string.char(32 + value)
	end
	return str
end


return format