Created
May 19, 2016 16:28
-
-
Save mAu888/a90e13c54a596ff94590ddb0b3e8a7de to your computer and use it in GitHub Desktop.
This file contains 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
struct Product { | |
let price: NSDecimalNumber | |
let locale: NSLocale | |
var priceString: String { | |
let formatter = NSNumberFormatter() | |
formatter.numberStyle = .CurrencyStyle | |
formatter.locale = locale | |
return formatter.stringFromNumber(price)! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment