Android Distance Readable Format distanceToKM(double distance)

Here you can find the source of distanceToKM(double distance)

Description

distance To KM

Declaration

public static String distanceToKM(double distance) 

Method Source Code

//package com.java2s;

public class Main {
    public static String distanceToKM(double distance) {
        return round(distance / 1000.0) + " km";
    }/*from  w  w  w. j  a v a2s . c o  m*/

    public static double round(double value) {
        return ((int) (value * 10) / 10.0);
    }
}

Related

  1. distance(float distanceInKm, boolean imperial)
  2. distanceToMiles(double distance)
  3. durationToHourMinOrMinSec(long duration)