We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a1d15a1 + d27b30a commit dee389bCopy full SHA for dee389b
Foundation/NSNumberFormatter.swift
@@ -52,6 +52,11 @@ public class NSNumberFormatter : NSFormatter {
52
/// - Note: Since this API is under consideration it may be either removed or revised in the near future
53
public func objectValue(string: String, inout range: NSRange) throws -> AnyObject? { NSUnimplemented() }
54
55
+ public override func stringForObjectValue(obj: AnyObject) -> String? {
56
+ guard let number = obj as? NSNumber else { return nil }
57
+ return stringFromNumber(number)
58
+ }
59
+
60
// Even though NSNumberFormatter responds to the usual NSFormatter methods,
61
// here are some convenience methods which are a little more obvious.
62
public func stringFromNumber(number: NSNumber) -> String? {
0 commit comments