Android SQLite Double variable giving garbage data on fetch
<p>I have a table defined as this</p>

<pre><code>String currencyTableQueryString = "create table if not exists "
            + CURRENCY_NAME + " (" + CURRENCY_ROW_ID
            + " integer primary key autoincrement not null,"
            + CURRENCY_USD + " double," + CURRENCY_INR + " double,"
            + CURRENCY_EUR + " double," + CURRENCY_GBP + " double"
            + ");";
</code></pre>

<p>i store data in this table from a JSON.
As an example, i have stored this data</p>

<pre><code>CURRENCY_USD = 1.0
CURRENCY_INR = 53.997369
CURRENCY_EUR = 0.764879
CURRENCY_GBP = 0.658136
</code></pre>

<p>In my next activity, i am fetching this data from the DB</p>

<pre><code>Ccursor = db.query(CURRENCY_NAME, new String[] { CURRENCY_ROW_ID, CURRENCY_USD, CURRENCY_INR,
            CURRENCY_EUR, CURRENCY_GBP }, null, null, null, null, null);
</code></pre>

<p>I ALWAYS get the wrong data when i fetch. It gives me very HIGH numbers in all my fields. I am not sure what i am doing wrong. (P.S. i am new to Java and Android programming).</p>

<p>this was the output from the fetch when the above numbers were inserted</p>

<pre><code>CURRENCY_USD = 1.072693248E9
CURRENCY_INR = -1.0925335E8
CURRENCY_EUR = -1.80473634E8
CURRENCY_GBP = 9.1173113E7
</code></pre>

<p>Can someone please guide me to what is going wrong here?</p>

<p>This is my fetch cursor.</p>

<pre><code>ArrayList&lt;ArrayList&lt;Object&gt;&gt; dataArrays = new ArrayList&lt;ArrayList&lt;Object&gt;&gt;();

    Cursor Ccursor;

    try {
        // ask the database object to create the cursor.
        Ccursor = db.query(CURRENCY_NAME, new String[] { CURRENCY_ROW_ID, CURRENCY_USD, CURRENCY_INR,
                CURRENCY_EUR, CURRENCY_GBP }, null, null, null, null, null);

        // move the cursor's pointer to position zero.
        Ccursor.moveToFirst();

        // if there is data after the current cursor position, add it
        // to the ArrayList.
        if (!Ccursor.isAfterLast()) {
            do {
                ArrayList&lt;Object&gt; dataList = new ArrayList&lt;Object&gt;();

                dataList.add(Ccursor.getLong(0));
                dataList.add(Ccursor.getDouble(1));
                dataList.add(Ccursor.getDouble(2));
                dataList.add(Ccursor.getDouble(3));
                dataList.add(Ccursor.getDouble(4));

                dataArrays.add(dataList);
            }
            // move the cursor's pointer up one position.
            while (Ccursor.moveToNext());
        }
        Ccursor.close();
    } catch (SQLException e) {
        Log.e("DB Error in Currency Retreive all", e.toString());
        e.printStackTrace();
    }
</code></pre>
