Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Conversor Celsius - Farenheit
Programa conversor. Prueba para curso iniciación a Elixir página web.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
defmodule Funciones do
def convertir(tipo, grados) when tipo =="aCel" do
(grados-32) * 5/9
end
def convertir(tipo, grados) when tipo =="aFah" do
(grados * 9/5) +32
end
end
IO.puts (Funciones.convertir("aCel",40))
IO.puts (Funciones.convertir("aFah",10))
Enter to Rename, Shift+Enter to Preview
Tech.io mola!
If you want a more complex example (external libraries, viewers...), use the Advanced Elixir template
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content