Skip to content

Conversation

@JamesSedlacek
Copy link

Copy link

@swift-student swift-student left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work again, James! You are showing solid understanding of all the concepts in this first sprint. Keep it up.

Comment on lines +54 to +58
var currencyFormatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
return formatter
}()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job using the number formatter to get the currency, and initializing it with a closure (that's what we it call when you do = { ... }()

Comment on lines +62 to +66
let USD_String = currencyFormatter.string(from: 1.00)
currency = .CAD
let CAD_String = currencyFormatter.string(from: NSNumber(value: convert(USD)))
currency = .MXN
let MXN_String = currencyFormatter.string(from: NSNumber(value: convert(USD)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember that by convention in Swift, variables should be lowercased, and not use underscores. I would suggest usdString cadString mxnString.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants