summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth@simponic.xyz>2026-04-22 20:29:50 -0700
committerElizabeth Hunt <elizabeth@simponic.xyz>2026-04-22 20:29:50 -0700
commit24b0469237285a05d9ffc05d18e43cc5dcdef00f (patch)
tree1c6924614b7d030c467919380d6c398d62efb602 /util.lua
parent078eca583eec21d317e931c84db8f084bef4305d (diff)
downloaddyl8-24b0469237285a05d9ffc05d18e43cc5dcdef00f.tar.gz
dyl8-24b0469237285a05d9ffc05d18e43cc5dcdef00f.zip
Stuff
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/util.lua b/util.lua
index bb9b2e8..157d7ad 100644
--- a/util.lua
+++ b/util.lua
@@ -49,4 +49,13 @@ function filter(a, pred)
end
end
return filtered
-end \ No newline at end of file
+end
+
+function fmt(x)
+ t = type(x)
+ if t == "number" then return "" .. x
+ elseif t == "string" then return x
+ elseif t == "boolean" and x then return "true"
+ elseif t == "boolean" and not x then return "false" end
+ return "NA"
+end