title: Storing a float value in SQLite changes the decimal precision in Room DB
body: <p>I need to store the price in my room database. I can have the decimal precision of 2 decimals or of 3 decimals depending on the country my app is being used at.</p>
  
  <p>While storing the float or even the double value in the sqlite database using the room library of android, it changes the value. For eg:
  14.54 is stored as 14.539999961853</p>
  
  <p>While debugging I can find the value is 14.54 only in the list that I pass to insert. But while checking for the saved records from the SQLite Browser app for windows. I see that the values have changed. I had manually entered a query using the sqlite browser and the value saves as is (the float value without changing the precision). Eg:</p>
  
  <pre><code>("INSERT INTO MYTABLE (ItemPrice) VALUES (14.54)");
  </code></pre>
  
  <p>The above query executes successfully and inserts the float of 14.54</p>
  
  <p>But in android using the following</p>
  
  <pre><code>@Insert 
  Long[] saveMyTable(final List&lt;MYTABLE&gt; myTable);
  </code></pre>
  
  <p>MyTable entity have a field as</p>
  
  <pre><code>public float ItemPrice;
  </code></pre>
  
  <p>while inserting the above query the values are changed</p>
  
  <p>I have also tried changing the data type in the DB Schema as real, float, double. But nothing helps.</p>