Created
February 21, 2017 17:18
-
-
Save sclark39/6d15f8acf0f690f0b4b9d1708199e79a to your computer and use it in GitHub Desktop.
What's in a name?
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
class Utility | |
{ | |
public class func _________( ___ ____: String ) -> Decimal? | |
{ | |
let formatter = NumberFormatter() | |
formatter.numberStyle = .currency | |
formatter.locale = Locale(identifier: "en_US") | |
if let number = formatter.number(from:____) | |
{ | |
return number.decimalValue | |
} | |
return nil | |
} | |
public class func _________( ___ ____: Decimal ) -> String? | |
{ | |
let formatter = NumberFormatter() | |
formatter.numberStyle = .currency | |
formatter.locale = Locale(identifier: "en_US") | |
return formatter.string(from: NSDecimalNumber(decimal: ____)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment