code: private String format(Object o)
     {
        String result;
  
        if (o == null)
        {
           result = "";
        }
        else
        {
           if (o instanceof Boolean == true)
           {
              result = LocaleData.getString(m_locale, (((Boolean) o).booleanValue() == true ? LocaleData.YES : LocaleData.NO));
           }
           else
           {
              if (o instanceof Float == true || o instanceof Double == true)
              {
                 result = (m_formats.getDecimalFormat().format(((Number) o).doubleValue()));
              }
              else
              {
                 if (o instanceof Day)
                 {
                    result = Integer.toString(((Day) o).getValue());
                 }
                 else
                 {
                    result = o.toString();
                 }
              }
           }
  
           //
           // At this point there should be no line break characters in
           // the file. If we find any, replace them with spaces
           //
           result = stripLineBreaks(result, MPXConstants.EOL_PLACEHOLDER_STRING);
  
           //
           // Finally we check to ensure that there are no embedded
           // quotes or separator characters in the value. If there are, then
           // we quote the value and escape any existing quote characters.
           //
           if (result.indexOf('"') != -1)
           {
              result = escapeQuotes(result);
           }
           else
           {
              if (result.indexOf(m_delimiter) != -1)
              {
                 result = '"' + result + '"';
              }
           }
        }
  
        return (result);
     }
docs: This method returns the string representation of an object. In most
  cases this will simply involve calling the normal toString method
  on the object, but a couple of exceptions are handled here.
  
  @param o the object to formatted
  @return formatted string representing input Object