summaryrefslogtreecommitdiff
path: root/lib/alcool.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/alcool.ex
parentwelp (diff)
bleh
Diffstat (limited to 'lib/alcool.ex')
-rw-r--r--lib/alcool.ex16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/alcool.ex b/lib/alcool.ex
new file mode 100644
index 0000000..40384ba
--- /dev/null
+++ b/lib/alcool.ex
@@ -0,0 +1,16 @@
+defmodule Alcool do
+
+ @spec units(Float.t, Float.t) :: Float.t
+ def units(cl, degrees) do
+ kg(cl, degrees)*100
+ end
+
+ def grams(cl, degrees) do
+ kg(cl, degrees)*1000
+ end
+
+ def kg(cl, degrees) do
+ (((cl/100) * 0.8) * (degrees/100))
+ end
+
+end