Re: [sqlite] round documentation

2010-05-28 Thread Matt Young
Bingo, I live and learn On 5/28/10, Igor Tandetnik wrote: > Igor Tandetnik wrote: >> Matt Young wrote: >>> I second that documentation confusion. There is no truncate to >>> integer, though I wish it would. >> >> Somewhat off-topic, but if you want truncation, this would do it: round(x >> - 0.5

Re: [sqlite] round documentation

2010-05-28 Thread Igor Tandetnik
Igor Tandetnik wrote: > Matt Young wrote: >> I second that documentation confusion. There is no truncate to >> integer, though I wish it would. > > Somewhat off-topic, but if you want truncation, this would do it: round(x - > 0.5) . Actually, cast(x as integer) works better. It follows the usu

Re: [sqlite] round documentation

2010-05-27 Thread Matt Young
OK, got it. I was referring to the number of decimal points, but yes round(x,0) does do something On 5/27/10, Igor Tandetnik wrote: > Matt Young wrote: >> Round(x,0) really doesn't exist, it simply does round(x,1) > > select round(4.1, 0), round(4.1, 1); > 4.04.1 > > -- > Igor Tandetnik > >

Re: [sqlite] round documentation

2010-05-27 Thread Igor Tandetnik
Matt Young wrote: > Round(x,0) really doesn't exist, it simply does round(x,1) select round(4.1, 0), round(4.1, 1); 4.04.1 -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sql

Re: [sqlite] round documentation

2010-05-27 Thread Matt Young
sqlite> select round(4.-.5); 4.0 sqlite> select round(4.-0); 4.0 sqlite> select round(4); 4.0 sqlite> select round(4,0); 4.0 sqlite> select round(4,1); 4.0 sqlite> select round(4,2); 4.0 sqlite> select round(4.666,2); 4.67 sqlite> Round(x,0) really doesn't exist, it simply does round(x,1) On 5/

Re: [sqlite] round documentation

2010-05-27 Thread Igor Tandetnik
Matt Young wrote: > I second that documentation confusion. There is no truncate to > integer, though I wish it would. Somewhat off-topic, but if you want truncation, this would do it: round(x - 0.5) . Well, it's more like floor(), it goes down rather than towards zero (which makes a difference

Re: [sqlite] round documentation

2010-05-27 Thread Matt Young
I second that documentation confusion. There is no truncate to integer, though I wish it would. On 5/27/10, Wilson, Ronald wrote: > From http://www.sqlite.org/lang_corefunc.html > > "The round(X,Y) function returns a string representation of the > floating-point value X rounded to Y digits to th

[sqlite] round documentation

2010-05-27 Thread Wilson, Ronald
>From http://www.sqlite.org/lang_corefunc.html "The round(X,Y) function returns a string representation of the floating-point value X rounded to Y digits to the right of the decimal point. If the Y argument is omitted, the X value is truncated to an integer." The documentation above is incorrec