Java tutorial
//package com.java2s; import java.text.DecimalFormat; public class Main { public static double convertKMToMiles(String kilometers) { DecimalFormat decimalFormat = new DecimalFormat("#"); int km = Integer.parseInt(kilometers); double miles = 0.621 * km; decimalFormat.format(miles); return Math.abs(miles); } }