public static String getDistanceFromKilometers(final Float distanceKilometers) {
        if (distanceKilometers == null || Float.isNaN(distanceKilometers) || Float.isInfinite(distanceKilometers)) {
            return "?";
        }

        final ImmutablePair<Double, String> scaled = scaleDistance(distanceKilometers);
        final String formatString;
        if (Math.abs(scaled.left) >= 100) {
            formatString = "%.0f %s";
        } else if (Math.abs(scaled.left) >= 10) {
            formatString = "%.1f %s";
        } else {
            formatString = "%.2f %s";
        }

        return String.format(formatString, scaled.left, scaled.right);
    }
formats given elevation in meters or feet, no fractions, no kilometers/miles
main/src/main/java/cgeo/geocaching/location/Units.java