I'm trying to check if a Decimal number is negative. Tried:
if value._isNegative {
...
}
But it gives the error 'UInt32' is not convertible to 'Bool'
let value: Double = -5.0
value.sign == .minus ? print("negative") : print("positive")
Try using value < 0. This will check if the value is less than 0.
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