Java Number to String numberToString(Object instance)

Here you can find the source of numberToString(Object instance)

Description

number To String

License

LGPL

Declaration

private static String numberToString(Object instance) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    private static String numberToString(Object instance) {
        String s = instance.toString();
        int i = s.lastIndexOf(".");
        if (i == -1) {
            return s;
        }/*  w w  w .  j a va  2s.  c  o m*/
        String result = s.substring(0, i);

        return result;
    }
}

Related

  1. numberToString(double num, int digits)
  2. numberToString(int gmNumber)
  3. numberToString(int number, int length, String type, int location)
  4. numberToString(Number number)
  5. numberToString(Object num)
  6. numberToStringFlushLeft(long number, int width)