Bogusław Brandys wrote:
Bogusław Brandys wrote:

Hello,

Maybe someone could explain me how to properly store float/decimal values into sqlite 3.X database ?

I created test table:

create table test(number double);

insert into test(number) values(11);

Now it looks like:

11.0

so, '.' seems to be always decimal separator.

But under my Windows XP decimal separator is ',' and I have problem retrieving this value using delphi. Of course I could set DecimalSeparator to '.' , but this require to use '.' widely in program which is not feasible.
Is there any pragma to set decimal separator it for sqlite database ?


Regards
Boguslaw Brandys



Ok.Found that when store value as text with proper decimal separator and precision like : 12,0 all is fine so it's rather a problem of formatting values.

Regards
Boguslaw Brandys



All would be fine but look at this :

create table test(
price double,
amount double default 0
);


insert into test(price) values("12,0");

amount now = 0.0


Of course it's not critical but maybe new pragma would be useful.


Regards
Boguslaw Brandys

Reply via email to