Re: [sqlite] How to round to an Integer

2018-10-19 Thread Rob Richardson
I don't think the cast rounds, though. It just truncates. Am I wrong? RobR On Thu, Oct 18, 2018 at 4:13 PM Richard Hipp wrote: > On 10/18/18, John Harney wrote: > > Recently figured this out. Seems to work fine > > > > trim(trim(round(1.111,0),'0'),'.') = 1 > > > > CAST(1.111 AS integer)

Re: [sqlite] How to round to an Integer

2018-10-18 Thread Keith Medcalf
On Thursday, 18 October, 2018 14:13, Richard Hipp wrote: >On 10/18/18, John Harney wrote: >> Recently figured this out. Seems to work fine >> trim(trim(round(1.111,0),'0'),'.') = 1 >CAST(1.111 AS integer) That should be CAST(round(x,0) as integer) if you want the rounded result as an

Re: [sqlite] How to round to an Integer

2018-10-18 Thread Richard Hipp
On 10/18/18, John Harney wrote: > Recently figured this out. Seems to work fine > > trim(trim(round(1.111,0),'0'),'.') = 1 > CAST(1.111 AS integer) -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list