summaryrefslogtreecommitdiff
path: root/lib/util.ex
diff options
context:
space:
mode:
Diffstat (limited to '')
-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