Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Oliver Peters
Charles Samuels writes: > > On Wednesday, February 02, 2011 11:06:59 am Drake Wilson wrote: > > Quoth Oliver Peters , on 2011-02-02 18:25:04 +: > > > I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but > > > sometimes > > > > Don't do that. ... Most people doing > > curre

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Charles Samuels
On Wednesday, February 02, 2011 11:06:59 am Drake Wilson wrote: > Quoth Oliver Peters , on 2011-02-02 18:25:04 +: > > I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but > > sometimes > > Don't do that. ... Most people doing > currency calculations should be using integers a

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Oliver Peters
Igor Tandetnik writes: > > On 2/2/2011 1:25 PM, Oliver Peters wrote: > > sqlite> SELECT CAST(2.3*100 AS INTEGER); > > 229<- S T R A N G E result > > select cast(round(2.3*100) as integer); > I knew you know it. thx a lot you're still the greatest :-) greetings to wherever you are Oliver _

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Stephan Wehner
On Wed, Feb 2, 2011 at 10:25 AM, Oliver Peters wrote: > Hello, > > I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but > sometimes > I get a strange result: > > SQLite version 3.7.5 > Enter ".help" for instructions > Enter SQL statements terminated with a " > sqlite> SELECT CAST

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Igor Tandetnik
On 2/2/2011 1:25 PM, Oliver Peters wrote: > sqlite> SELECT CAST(2.3*100 AS INTEGER); > 229<- S T R A N G E result select cast(round(2.3*100) as integer); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/c

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Drake Wilson
Quoth Oliver Peters , on 2011-02-02 18:25:04 +: > I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but > sometimes > I get a strange result: Don't do that. Read up on the Web about the properties of binary floating-point representations. They are not decimal and if you have

[sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Oliver Peters
Hello, I'm on Win XP with sqlite 3.7.5 and trying to get cents from euro but sometimes I get a strange result: SQLite version 3.7.5 Enter ".help" for instructions Enter SQL statements terminated with a " sqlite> SELECT CAST(2.1*100 AS INTEGER); 210 sqlite> SELECT CAST(2.2*100 AS INTEGER); 220 sql