code: private String formatObject(Object obj) {
          if (obj == null) {
              return null;
          }
  
          if (obj instanceof Number) {
              return NumberFormat.getInstance(locale).format(obj); // fix
          } else if (obj instanceof Date) {
              return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale).format(obj); //fix
          } else if (obj instanceof String) {
              return (String) obj;
          }
  
          return obj.toString();
      }
docs: Formats object.
  
  @param obj Object to be formatted into string
  @return Formatted object