summaryrefslogtreecommitdiff
path: root/lib/util.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2020-04-17 15:53:14 +0200
committerhref <href@random.sh>2020-04-17 15:53:14 +0200
commit919725a6941830ce82c835ed3288c1722ddd8c9f (patch)
tree49a95b0ce716a24c7e056036d3353ceca1debe4a /lib/util.ex
parentwelp (diff)
bleh
Diffstat (limited to 'lib/util.ex')
-rw-r--r--lib/util.ex13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/util.ex b/lib/util.ex
new file mode 100644
index 0000000..f515936
--- /dev/null
+++ b/lib/util.ex
@@ -0,0 +1,13 @@
+defmodule Util do
+
+ def plusminus(number) when number > 0, do: "+#{number}"
+ def plusminus(0), do: "0"
+ def plusminus(number) when number < 0, do: "#{number}"
+
+ def float_paparse(string) do
+ string
+ |> String.replace(",", ".")
+ |> Float.parse()
+ end
+
+end