----- Original Message ----- 
From: "Dan Phillips" <[email protected]>
To: "General Discussion of SQLite Database" <[email protected]>
Sent: Tuesday, October 13, 2009 2:40 AM
Subject: Re: [sqlite] low-level view of data values?


> On Tue, Oct 13, 2009 at 2:01 AM, Robert Simpson <[email protected]> 
> wrote:
>> I'm pretty sure I do store them as strings -- SQLite doesn't have a
>> "decimal" datatype, and "double" doesn't cut the precision mustard for
>> emulating "decimal".
>
> Yes, but I believe the Decimals-as-text will only work if the column
> is declared as TEXT rather than as NUMERIC. If it is NUMERIC, then the
> Decimals will be end up being stored as REALs. You can verify this by
> doing a "select typeof(MyField)" SQL statement.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


The best way I have found to manage decimal (Business math) with most all 
the databases is to use integers and multiply and divide by the decimal 
offset (i.e. 10, 100, 1000) for presentation purposes,  doing my own 
"bankers rounding"  in code.  Big hassle, but transports well.

As long as computer scientists are driving the bus, business math will 
remain a step child, although probably 90+ % of all db apps are business 
related, IMHO.  No offence intended Dr. H!

Fred

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to