tuple(int, int) --> FixedPoint; is there a better way?

Piet van Oostrum piet at cs.uu.nl
Mon Dec 2 07:33:17 EST 2002


>>>>> kosh at aesaeion.com (K) writes:

K> On 2 Dec 2002, Piet van Oostrum wrote:
HW> Hello,
HW> I have selected a value from a currency type column in MS Access using
HW> ADO. The currency type in Access is a 64 bit integer with 4 decimal
HW> places precision. Somewhere between the database and my program this
HW> gets turned into a tuple of two 32 bit integers, the first one signed
HW> and the second one unsigned.
>> 

K> Why not convert both parts to a string add them together and then conver
K> to a long. That should give the affect you are looking for easily.

You would have to use HEX then, and at least for the second part,
exactly 8 digits.
And it would be slower. I consider int->string->int a detour if you
can get the same with only int arithmetic.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl





More information about the Python-list mailing list