I know in sqlite we can define column decimal precision with DECIMAL(10,2)
How can this be achieved with Android Room
Eg. I want room table column to store 1000.33, when I insert 1000.3333333333
>Solution :
You cannot define the precision.
All REAL (the storage class used for decimal/float/double values) values are stored in SQLite as an 8-byte IEEE floating point number. An alternative approach would be store the value as a String BUT not a String that can be considered a numeric e.g. (as it would be stored as such) you could store the value D1000.33. i.e. the D ensures that the value is stored/retrieved as a String.
You need to apply the required precision when (e.g. using the SQLite round function) or after you extract the value.