title: Convert min per km to display on TextView
body: <p>I developing a run tracker app, I already calculated an average pace that gives me a minute per km time. But now I cant understand how to convert this value to show it in this format 00:00. </p>
  
  <p>This is the relevant method:</p>
  
  <pre><code>    private void setPace(double distanceInMeters) {
      double totalTimeinSec = (timer.getTimeInSeconds() + (timer.min * 60));
      double metersPerSecond = (distanceInMeters / totalTimeinSec);
      double minPerKm = 16.6666667 / metersPerSecond;
      // convert minPerKm
  }
  </code></pre>
  
  <p>The values that it gives me for example for Duration time: <code>00:13:07</code> and distance of <code>2.02</code>:</p>
  
  <ul>
  <li><code>totalTimeinSec = 787.0</code></li>
  <li><code>metersPerSecond = 2.5607004323181384</code></li>
  <li><code>minPerKm = 6.508635875424163</code></li>
  </ul>
  
  <p>I need to convert <code>minPerKm</code> to a real time to show it in average pace.
  Anyone can help please?</p>
  
  <p>Found the solution!
  My corrected code, maybe will help anyone: </p>
  
  <pre><code>    private void setPace(double distanceInMeters) {
      double totalTimeinSec = (timer.getTimeInSeconds() + (timer.min * 60));
      double metersPerSecond = (distanceInMeters / totalTimeinSec);
      double minPerKm = 16.6666667 / metersPerSecond;
      double secondsPerKm = minPerKm * 60;
      int sec = (int)(secondsPerKm);
      int min = sec / 60;
      sec %= 60;
      Log.d("PACE","Your pace is: " + String.format("%02d",min) + ":" + String.format("%02d",sec));
      // convert minPerKm
  }
  </code></pre>