On Mon, May 17, 2010 at 08:17:02AM -0700, Roger Binns scratched on the wall: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 05/17/2010 06:29 AM, Samuel Adam wrote: > > Plug for outstanding feature request: DECIMAL type > > Leaving the merits of the type aside, adding it would make the database > incompatible with every existing SQLite library version already out there. > That is not done lightly. > > Additionally for the code to be compatible with SQLite's license, a public > domain library implementation would be needed for the vast majority of > platforms that do not support the type in hardware. This is a non-trivial > amount of work. > > You can of course fork SQLite and add the type yourself.
It would also be possible to do a pretty good job with an extension. I would either store them as text values or BCD BLOBs. An extension that contained basic conversion functions, conversions, possible collations, and basic math operators would get you most of the way there. It would make a lot of the SQL a bit ugly, but it could be done. The other options is to just use fixed-point integer values (e.g. an integer value that is 1 cent, or 1/100th of a cent, or whatever range you need). You need to be careful about the math, but that would be much simpler. 64-bit integers give you a fair amount of room to play with. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string." --from Anathem by Neal Stephenson _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

