Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.text.DecimalFormat;

public class Main {
    public static final String objectToString(Object obj, DecimalFormat fmt) {
        fmt.setDecimalSeparatorAlwaysShown(false);
        if (obj instanceof Double)
            return fmt.format(((Double) obj).doubleValue());
        if (obj instanceof Long)
            return fmt.format(((Long) obj).longValue());
        else
            return obj.toString();
    }
}