Re: [sqlite] Is there a way to select a precision?

2013-05-07 Thread Michael Black
nt: Monday, May 06, 2013 8:03 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Is there a way to select a precision? On Mon, 6 May 2013 07:42:43 -0500 "Michael Black" wrote: > Yes...other databases do respect NUMBER(10,2) on SELECT's. ... > Can you simply use round to do

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread James K. Lowden
On Mon, 6 May 2013 07:42:43 -0500 "Michael Black" wrote: > Yes...other databases do respect NUMBER(10,2) on SELECT's. ... > Can you simply use round to do what you want? > CREATE TABLE stuff(f number(10,2)); > INSERT INTO "stuff" VALUES(1.0/3.0); > sqlite> select f from stuff; > 0.333

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread Keith Medcalf
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of ven...@intouchmi.com > Sent: Monday, 06 May, 2013 06:20 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Is there a way to select a precision? > > Yo

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread Simon Slavin
On 6 May 2013, at 2:10pm, Simon Slavin wrote: > You can format them after retrieving them from the database, or you can > format them before retrieving them from the database before putting them in > the database, in which case you should consider that you're storing strings, > not numbers.

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread Simon Slavin
On 6 May 2013, at 1:14pm, Paul van Helden wrote: > My point was about not storing binary junk - the part of a number that has > no meaning because the accuracy of the inputs is limited. When you have a > generic db manager that can show any table or if you are looking at the > results of your ow

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread Michael Black
org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Paul van Helden Sent: Monday, May 06, 2013 7:15 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Is there a way to select a precision? > A delared type of NUMBER(10,2) has NUMERIC affinity, which means that > SQLite wil

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread veneff
You could always store the precision info in another column or two. Vance on May 06, 2013, Paul van Helden wrote: > >> A delared type of NUMBER(10,2) has NUMERIC affinity, which means that >> SQLite will attempt to store (string) values as integers first and floats >> second before giving up and

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread Paul van Helden
> A delared type of NUMBER(10,2) has NUMERIC affinity, which means that > SQLite will attempt to store (string) values as integers first and floats > second before giving up and storing strings. > This has nothing to do with my reply and I understand how it works. > > You do realize that there ar

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread Hick Gunter
Von: Paul van Helden [mailto:p...@planetgis.co.za] Gesendet: Montag, 06. Mai 2013 10:05 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Is there a way to select a precision? > > > What do you mean, select precision? The double value you pass to > sqlite3_bind_double() w

Re: [sqlite] Is there a way to select a precision?

2013-05-06 Thread Paul van Helden
> > > What do you mean, select precision? The double value you pass to > sqlite3_bind_double() will be used as is. Are you saying you want to round > it first? Then go ahead and do that - I'm not sure what that has to do with > SQLite. > -- > It is an issue with SQLite because the values in NUMBER(

Re: [sqlite] Is there a way to select a precision?

2013-05-05 Thread Alessandro Marzocchi
If what you want is a way to store floating point numbers with a precision other than double (8 bytes) to decrease space usage or to get more precisione the answer is no. The only native data types for sqlite are integer (which can simulate bools), string, double and blob. Plus of course NULL... Se

Re: [sqlite] Is there a way to select a precision?

2013-05-05 Thread Igor Tandetnik
On 5/5/2013 8:24 PM, Igor Korot wrote: Is there a way to select a precision either on the call to sqlite3_bind_double() or before it? What do you mean, select precision? The double value you pass to sqlite3_bind_double() will be used as is. Are you saying you want to round it first? Then go a

[sqlite] Is there a way to select a precision?

2013-05-05 Thread Igor Korot
Hi, ALL, Is there a way to select a precision either on the call to sqlite3_bind_double() or before it? Other than the call to sprintf() Thank you. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo