Elixir - Conversor Celsius - Farenheit (version 1)

mat130517
956 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

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
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))
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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