Elixir - Conversor Celsius - Farenheit (version 1)

mat130517
1,167 views
undefined

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.

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