How to use SQLite decimal precision notation -


again find myself frustrated awful sqlite documentation.

http://www.sqlite.org/datatype3.html gives example of defining decimal field decimal(10,5) doesn't explain 10 , 5 is.

i sure 10 total number of digits stored, don't know 5 means. number of digits before decimal place or after decimal place?

that page says:

in sqlite, datatype of value associated value itself, not container.

which means declared data type has no effect on values can stored in column.

the example explains decimal(10, 5) column has numeric affinity, i.e., values stored in column prefeered numbers:

> create table mytable(x decimal(10, 5)); > insert mytable values (1), ('2'), (1.23456789), ('hello'), (x'42'); > select x, typeof(x) mytable; 1           integer 2           integer 1.23456789  real hello       text b           blob 

otherwise, type ignored; use use decimal(-123, 999999), or fluffy bunnies.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -