Java tutorial
//package com.java2s; import java.text.DecimalFormat; public class Main { public static String formatDistance(double distance) { String dis = "0"; DecimalFormat df = new DecimalFormat("0.0"); String result = df.format(distance); return result; } }