Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.math.BigDecimal;

public class Main {
    public static String conversionDistanse(int aDistanceMeter) {
        return (aDistanceMeter >= 1000) ? Math.round((new BigDecimal(String.valueOf(aDistanceMeter / 1000))
                .setScale(1, BigDecimal.ROUND_HALF_UP).longValue())) + "km" : aDistanceMeter + "m";
    }
}