Using 'num1' as a comparison reference to determine if 'num2' or 'num3' are zero. Have done this successfully in Objective-C, and am trying to do it in Swift:
let num1: NSDecimalNumber = NSDecimalNumber.zero()
let num2: NSDecimalNumber = NSDecimalNumber.decimalNumberWithString("0")
let num3: NSDecimalNumber = NSDecimalNumber.decimalNumberWithString("0.000001")
if num1.compare(num2) == NSOrderedSame {
println("They match")
}
This attempt results in: "error: use of unresolved identifier 'NSOrderedSame'." What is the proper way to accomplish this in Swift? (Have searched the book and web, but missing something possibly obvious, thank you).
Do you mean: num1.compare(num2) == NSComparisonResult.OrderedSame
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With