[Pyobjc-dev] how do I convert NSDecimalNumber to a native python number type?
Brought to you by:
ronaldoussoren
From: Mark I. <zo...@sb...> - 2006-07-11 16:15:20
|
I have an NSTextField bound to minutes() and setMinutes_() methods using Cocoa bindings. I dropped an NSNumberFormatter on it in Inteface Builder. Now, the values passed into setMinutes_() are of type NSDecimalNumber and I can't for the life of me figure out how to get them to an int. I've looked through the PyObjC NEWS file and searched Google. NSDecimalNumbers don't have an as_int() method. Python's built-in int () doesn't like them. It doesn't seem to convert on the fly (I was trying to multiply it with int literals). Surely I'm missing something simple, I just don't know what it is. -Mark Ivey- |