diff options
author | href <href@random.sh> | 2020-04-17 15:53:14 +0200 |
---|---|---|
committer | href <href@random.sh> | 2020-04-17 15:53:14 +0200 |
commit | 919725a6941830ce82c835ed3288c1722ddd8c9f (patch) | |
tree | 49a95b0ce716a24c7e056036d3353ceca1debe4a /lib/util.ex | |
parent | welp (diff) |
bleh
Diffstat (limited to 'lib/util.ex')
-rw-r--r-- | lib/util.ex | 13 |
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 |