If you cast the conversion to Any
, then that will work because the compiler is happy that either Decimal
or String
can used:
import Foundationlet iAmNil: Decimal? = nillet iAmDecimal: Decimal? = 12.34print(String(describing: (iAmDecimal ?? "") as Any))// Prints 12.34\n