Bert Verhees wrote:
Carl Jacobs wrote:
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
The world seems to have settled on using Arabic numerals 0, 1, 2 ... 9. I
think we should think about settling on . as the decimal separator, it
would
save a bit of confusion if we all used the same notation.
It is only the English speaking part of the world using Arabic numerals
is a '.', which is a minority
The rest uses a ','
I think we should settle there
;-)
I think a pragma would be a good thing.
I suspect that "12,0" is being stored as a string. Don't forget that
for all
intents and purposes sqlite3 is typless, so it will store your value in
whatever is the most compact form. So, if you want to, you can store a
picture of yourself in field price!
Regards,
Carl.
The problem is that I use not finished wrapper which is not using
sqlite3_bind_double but instead I must pass double/currency as text
which is created based on Windows regional decimal separator.
That way :
select cast(price as double) from test
always return 0.0
not good
I understand that using sqlite3_bind_double would help but I cannot.
Pragma for decimal separator could help in that case and sqlite3 should
automatically convert 12,0 into double and store as double (like when I
use 12.0)
So,it's not so stupid but rather a conversion hell.
Regards
Boguslaw Brandys