[python-win32] PyCY: a CY type wrapper

Jorgensen, Jens jens.jorgensen@tallan.com
Thu, 27 Dec 2001 12:31:15 -0600


  Ok, I needed this beast so I created it. This compiled python 
extension for Python 2.1 wraps Windows CY values. As I mentioned the 
currency value is stored as a signed 64-bit integer that is scaled by 
10e4. That is, it has precision to 1/10,000 of a unit. You can 
instantiate from a python int, float or tuple of two ints which is what 
Python returns when a Windows function returns this type of value. You 
can add them, subtract them, multiply, etc. all except for invert. It 
can convert to a Python int, float, string, or long. I didn't do the 
type coercion function because I don't know its semantics. I'm just 
putting this up on my personal page for the moment:

http://www.ultraemail.net/~jbj1/PyCY.tar.gz

If you don't know why you'd want this then you don't need it. ;)

It would be nice of course if the COM guts would return this class (ie. 
this class should be in pywintypes!) and perhaps Mark is interested?

-- 
Jens B. Jorgensen
jens.jorgensen@tallan.com