Android String to Double Convert parseDistance(double distance)

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

Description

parse Distance

Declaration

public static String parseDistance(double distance) 

Method Source Code

//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*/
}

Related

  1. transformToDigit(String numString)
  2. getDouble(String str, double defaultValue)
  3. getDoubleFromStr(String str)
  4. getDoubleValue(String value)
  5. parseDouble(String string, double defValue)
  6. toDouble(String s)