title: how to convert the double value to n places in java (giving the answer ,not asking the question)
body: <pre class="lang-java prettyprint-override"><code>DecimalFormat df = new DecimalFormat("0.00");//if you want over four decimal places then do-&gt;"0.0000" in brackets
  
  TextView lattextview=findViewById(R.id.lattextview);
  TextView lontextview=findViewById(R.id.longtextview);
  TextView alttextview=findViewById(R.id.alttextview);
  TextView accuracytextview=findViewById(R.id.accuracytextview);
  TextView addresstextview=findViewById(R.id.addresstextview);
  
  String s1 = df.format(location.getLatitude());
  String s2 = df.format(location.getLongitude());
  String s3 = df.format(location.getAltitude());
  String s4 = df.format(location.getAccuracy());
  lattextview.setText("Latitude : "+s1);
  lontextview.setText("Longitude : "+s2);
  alttextview.setText("Altitude : "+s3);
  accuracytextview.setText("Accuracy : "+s4);
  </code></pre>