Here you can find the source of parseDistance(double distance)
public static String parseDistance(double distance)
//package com.java2s; import java.text.DecimalFormat; public class Main { public static String parseDistance(double distance) { DecimalFormat df = new DecimalFormat("#.##"); return df.format(distance) + " km"; }/* w w w. ja va 2 s .com*/ }