summaryrefslogtreecommitdiff
path: root/format.lua
diff options
context:
space:
mode:
Diffstat (limited to 'format.lua')
-rw-r--r--format.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/format.lua b/format.lua
new file mode 100644
index 0000000..3a126a9
--- /dev/null
+++ b/format.lua
@@ -0,0 +1,22 @@
+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.ascii32 (tvalues)
+ local str = ""
+ for _, value in ipairs(tvalues) do
+ str = str .. string.char(32 + value)
+ end
+ return str
+end
+
+
+return format