Re: [sqlite] float to string conversion problem

2013-06-14 Thread Kevin Benson
On Fri, Jun 14, 2013 at 6:34 PM, Filipe Madureira < filipe.madure...@sysdevsolutions.com> wrote: > Hi, > > Thanks for the great help. > I tracked the problem to et_getdigit() > More precisely to: > digit = (int)*val; > > So, SQLite is assuming that "double" to "int" cast will truncate the > value.

Re: [sqlite] float to string conversion problem

2013-06-14 Thread Filipe Madureira
Hi, Thanks for the great help. I tracked the problem to et_getdigit() More precisely to: digit = (int)*val; So, SQLite is assuming that "double" to "int" cast will truncate the value. This should be true. But in this device this is not happening, so if "val" is 2.55 I get 3 in "digit". Anyon

Re: [sqlite] float to string conversion problem

2013-06-14 Thread Arjen Markus
Hi Richard, On Fri, 14 Jun 2013 08:26:19 -0400 Richard Hipp wrote: SQLite has its own printf() implementation. It has to. If it used system printf(), than certain LOCALE settings would turn "." into "," and introduce syntax errors. The build-in printf() of SQLite also introduces a numbe

Re: [sqlite] float to string conversion problem

2013-06-14 Thread Richard Hipp
On Fri, Jun 14, 2013 at 8:19 AM, Arjen Markus wrote: > I have no solution to offer and you probably thought of it > yourseld too, but the + might be an attempt (rather > superfluous and annoying) to indicate upward rounding > took place. > > Does this happen with an ordinary C program too? The cul

Re: [sqlite] float to string conversion problem

2013-06-14 Thread Noel Frankinet
Hello, The pda probably has no floating point support, you should check how sqlite as been compiled. Best wishes Noël On 14 June 2013 14:19, Arjen Markus wrote: > Hi Filipe, > > > On Thu, 13 Jun 2013 15:59:35 +0100 > Filipe Madureira > > > wrote: > >> Hi, >> >> I have a problem executing a q

Re: [sqlite] float to string conversion problem

2013-06-14 Thread Richard Hipp
On Thu, Jun 13, 2013 at 10:59 AM, Filipe Madureira < filipe.madure...@sysdevsolutions.com> wrote: > can someone tell me where in the source code the float (or double, I > don't know) value of 2.55 is being converted to a string to be outputed > Floating point to ASCII conversion happens here:

Re: [sqlite] float to string conversion problem

2013-06-14 Thread Arjen Markus
Hi Filipe, On Thu, 13 Jun 2013 15:59:35 +0100 Filipe Madureira wrote: Hi, I have a problem executing a query on a WinCE6 ARM device. I use SQlite for years and tested on all types of devices including WinCE6 ARM and never had a problem. But I have one problem on particular device that ha

[sqlite] float to string conversion problem

2013-06-14 Thread Filipe Madureira
Hi, I have a problem executing a query on a WinCE6 ARM device. I use SQlite for years and tested on all types of devices including WinCE6 ARM and never had a problem. But I have one problem on particular device that has a Texas Instruments ARM CPU with WinCE6. A very simple way to reproduce