Sam
03/22/2023, 10:35 PMNSNumber
you can just cast your Kotlin number, but the IDE thinks "this cast will never succeed". Is that just a false positive? I've tried casting from Number
, Int
, Double
, UInt
, and it doesn't like any of them.Sam
03/22/2023, 10:37 PM@Suppress
the warning?)jw
03/22/2023, 10:42 PM.convert()
Sam
03/22/2023, 10:44 PMNumber
, which doesn't appear to have the method. I guess I could do .toDouble().convert()
but that seems wasteful if the straight cast will work.jw
03/22/2023, 10:46 PMSam
03/22/2023, 10:46 PMjw
03/22/2023, 10:46 PMSam
03/22/2023, 10:47 PMSam
03/22/2023, 10:47 PMNSNumberFormatter
from the iOS sourcesetSam
03/22/2023, 10:47 PMNumber
formattingSam
03/22/2023, 11:10 PMSam
03/23/2023, 12:27 AM@Suppress("CAST_NEVER_SUCCEEDS")
satisfies my desire to be rid of the false warning 🙂Landry Norris
03/23/2023, 1:39 PM