code: public static String getFormat(Object o, int precision) {
  		if (o instanceof Double || o instanceof Float)
  			return getFloatFormat(precision);
  		if (o instanceof Integer || o instanceof Long || o instanceof Short || o instanceof Byte)
  			return INTEGER_FORMAT;
  		return STRING_FORMAT;
  	}
docs: Returns an appropriate format for the given object, considering the
  specified precision in case the object is a non-integer number.<br>
  <ul>
  <li>case 1: object is of type <code>Float</code> or <code>Double</code>
  -> float format with the specified precision</li>
  <li>case 2: object is a whole number -> integer format</li>
  <li>case 3: object is of any other type -> string format</li>
  </ul>
  
  @param o
  Object for which a format has to be assigned
  @param precision
  Desired precision
  @return An appropriate format for the given object