On 30 Nov 2016, at 3:52pm, Werner Kleiner <sqlitetes...@gmail.com> wrote:

> <<Declare it as REAL.
> 
> I tried this, but Inserting 1.700 is also stored as 1.7
> 
> With TEXT I can store it like 1.700 but we want to calculate later
> with PHP or C#

If what you want is calculation-ready value, then storing it as REAL=1.7 is 
correct.

If what you want is a print-ready value, then storing it as TEXT='1.700' is 
correct.

There is no type which is good for both things.

Since most print routines already have formatting options which allow you to 
specify the number of decimal points, it’s more convenient to store as a number 
and worry about the text format only when you’re printing.

On the other hand, if you value the accuracy of a money calculation very 
highly, then you should be storing an integer, not a REAL value.  This means 
you do not run the risk of storing a value which is not an exact amount of 
money.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to