You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,10 +35,12 @@ Create a new playground in this repository called "CurrencyConverter"
35
35
* Check the value of `currency` to see whether you should convert to CAD or MXN
36
36
* Perform the conversion with the dollars passed into this method
37
37
* Return the converted value
38
-
6. Create a function called `convert(amountString: String) -> Double` In it, do the following:
38
+
6. Create a function called `convert(amountString: String) -> String?` In it, do the following:
39
39
* create a constant called `amount`. Its value should be the `amountString` that is initialized into a `Double`
40
40
* use a `guard let` to unwrap the new `amount` constant.
41
41
* convert the dollar amount to the expected currency (hint, you'll want to call the `convert` method you created in step 4
42
+
7. Test your code by calling `convert(amountString` with some values. Change your `currency` to both `.cad` and `.mxn` to make sure the conversion works for both currencies.
0 commit comments