I am trying to store currency values in sqlite database in android. I don’t think so that int will be used here. I have heard that Bigdecimal can be used. If anyone can tell me the way it should be used to send values to sqlite database.
I am trying to store currency values in sqlite database in android. I don’t
Share
Store the BigDecimal as a String.
You can use the toPlainString() method.
Then when you pull it from the database you can create a new BigDecimal.
Believe it or not SQLite 3.0 stores all data types as strings even if you say it should be an Integer. Take a look at this web page from the official SQLite website and scroll down to the “Manifest Typing and BLOB Support” section. It talks about how it will let you store strings in columns of other types.