title: Why is a decimal place being removed when I insert data? SQLite (Android Development)
body: <p>I am attempting to enter values such as "0.20" within a table but when I display it within an activity it shows "0.2". I am uncertain as to why the '0' is being removed i.e. incorrect structure of the table, insertion, or being returned. </p>
  
  <p>My table is created as followed: </p>
  
  <pre><code>db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" + KEY_ROWID
                  + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_NAME
                  + " TEXT NOT NULL, " + KEY_SWIMMERLAPS + " INT NOT NULL, "
                  + KEY_SPONSOR + " DEC(4,2) NOT NULL );");
  </code></pre>
  
  <p>I then insert the data: </p>
  
  <pre><code>public long addSwimmer(String name, String laps, String sponsor) {
      int i = Integer.parseInt(laps);
      ContentValues cv = new ContentValues();
      cv.put(KEY_NAME, name);
      cv.put(KEY_SWIMMERLAPS, i);
      cv.put(KEY_SPONSOR, (new DecimalFormat("0.00##")).format(0.20));
      return ourDatabase.insert(DATABASE_TABLE, null, cv);
  }
  </code></pre>
  
  <p>and then return the sponsorship data:</p>
  
  <pre><code>public String getSwimmerSponsors() {
      String[] columns = new String[] { KEY_SPONSOR };
      Cursor c = ourDatabase.query(DATABASE_TABLE, columns, null, null, null,
              null, KEY_SWIMMERLAPS + " DESC");
      String result = "";
  
      for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
          result = result + c.getString(0) + "\n";
      }
      return result;
  }
  </code></pre>
  
  <p>Edit - I display the returned result in my layout as follows:</p>
  
  <pre><code>String sponsors = swimmerDb.getSwimmerSponsors();
      tvSponsor.setText(sponsors);
  </code></pre>
  
  <p>Thanks. </p>