title: android set part of the stars in the rating bar if the value is in decimal places
body: <p>I would like to show the user's score using the ratingbar.
  For example, if the user gets 7 out of 30 questions correct, the textview (tv_percentage) shows correctly for 23.33%, yet the rating star, which should then show 1.17 stars out of 5 stars, yet now is that whatever the score is, is always showing 5 stars. </p>
  
  <p>What have I done wrong for the following?</p>
  
  <h2>Code:</h2>
  
  <pre><code>    SharedPreferences score = this.getSharedPreferences("MyApp", 0);
      int userscore = score.getInt("score", 0);
      int userQnumber = score.getInt("number_of_question_to_selected", 9999);     
  
      double scoring100 = Double.valueOf(userscore) / Double.valueOf(userQnumber) *100;
      String stripped2 = Double.valueOf(scoring100).toString();       
      DecimalFormat myFormatter1 = new DecimalFormat("###,###,###.##");       
  
      stripped2 = myFormatter1.format(Double.valueOf(stripped2));     
      tv_percentage.setText(""+stripped2+"%");        
  
      ratingBar1.setRating(Float.parseFloat(stripped2)); 
  </code></pre>
  
  <h2>editted code:</h2>
  
  <pre><code>    float d= (float) (scoring100 /100 * 5);
      String S = Double.valueOf(d).toString();    
      tv2_90.setText(""+S); // for testing only, tv2_90 showing proper value
      ratingBar1.setStepSize((d));
      ratingBar1.setRating(Float.parseFloat(stripped2)); 
  </code></pre>
  
  <h2>Layout:</h2>
  
  <pre><code>            &lt;RatingBar
                  android:id="@+id/ratingBar1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:isIndicator="true"
                  android:max="100"
                  android:numStars="5"
                  android:stepSize="0.1" /&gt;
  </code></pre>