Last active
March 4, 2020 18:35
-
-
Save felipebweber/51a4dfbb1439db959ef5888f48a39bde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let primeiroValorString = "20" | |
let segungoValorStrig = "2" | |
if let primeiroValor = Double(primeiroValorString){ | |
print(primeiroValor) | |
if let segundoValor = Double(segungoValorStrig){ | |
print(segundoValor) | |
let soma = primeiroValor + segundoValor | |
print("Soma: \(soma)") | |
}else{ | |
print("Segundo valor não pode ser convertido para Double") | |
} | |
}else{ | |
print("Primeiro valor não pode ser convertido para Double") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment