Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String distToString(Float dist) {
        if (dist == null) {
            return "";
        }
        if (dist > 999) {
            return String.format("%.2fkm", dist / 1000);
        } else {
            return String.format("%dm", dist.intValue());
        }
    }
}