From 919725a6941830ce82c835ed3288c1722ddd8c9f Mon Sep 17 00:00:00 2001 From: href Date: Fri, 17 Apr 2020 15:53:14 +0200 Subject: bleh --- lib/util.ex | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/util.ex (limited to 'lib/util.ex') 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 -- cgit v1.2.3