COM - Currency

Matt Singer mrsinger at usa.net
Thu Dec 26 18:02:28 EST 2002


Thanks Mark,

   I was trying to stay away from having to use an SQL statement, but
I guess its not "that bad". ;-)

Matt Singer

Mark Hammond <mhammond at skippinet.com.au> wrote in message news:<wyNM9.1254$Fi2.1827 at news-server.bigpond.net.au>...
> Matt Singer wrote:
> > I understand:
> > 
> > "A currency number stored as an 8-byte, two's complement
> > integer, scaled by 10,000 to give a fixed-point number with 15 digits
> > to
> > the left of the decimal point and 4 digits to the right.  This
> > representation provides a range of 922337203685477.5807 to
> > -922337203685477.5808"
> > 
> > And that for example if you read $3.50, you will get (0, 35000).
> > 
> > Now, when adding a record, what is the syntax for setting a field that
> > is of type currency?
> 
> You can't :(  I am unlikely to fix this either - the FixedPoint module 
> is being added to the core for Python 2.3, so I will almost certainly 
> fix currency support in *both* directions using this module.  This will 
> break people who rely on the tuple for currency, but I don't mind too 
> much as it is completely useless and only works in one direction anyway.
> 
> Mark.



More information about the Python-list mailing list