-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, Sep 29, 2006 at 12:19:07PM +0200, Martijn van Oosterhout wrote: > On Thu, Sep 28, 2006 at 06:32:11PM -0500, Jim C. Nasby wrote: > > What would be ideal is a money type that stored what currency was used > > and let you change precision (within reason). > > The taggedtypes version of currency does half of that, by storing the > currency and allowing the output format to depend on that. It doesn't > allow you to easily change the precision though, that would require > user-defined typmod which is still under discussion. > > It would be possible to create a taggedtypes version of currency based > on int64. With the currency tag it would be 12 bytes total. And the > number of decimal places could be defined per currency... > > Interesting thought, probably wouldn't take more than an hour to whip > up.
If you are at that, it's worth noting that the currency tag consists of three capital ASCII letters. That would be fifteen bits, take or give. That leaves fourty-eightish bits for the number or about 10^14. THis is only half-serious, since there are other problems with currencies (their value is dependent on time, all that Pandora's box). Regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFHfWlBcgs9XrR2kYRAhieAJ9GYKruXeW3nqGyg0TO8Mo5bFBNMQCfbfzK lbARH+l5PxIexOElcxTg3WE= =//LX -----END PGP SIGNATURE----- ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster