How to cast an NSDecimal value into an NSInteger value?

Posted by mystify on Stack Overflow See other posts from Stack Overflow or by mystify
Published on 2010-03-30T20:47:37Z Indexed on 2010/03/30 21:03 UTC
Read the original article Hit count: 279

Filed under:

I have an situation where I get an NSDecimal, and I need an NSInteger. I do know it is a very small value (this is absolutely sure). It won't be bigger than 100. So It would be perfectly fine to cast it to NSInteger, no overflow would happen.

How could this be done? There's just an -doubleValue method in NSDecimal.

© Stack Overflow or respective owner

Related posts about iphone