code: public static final String printExtendedAttribute(MSPDIWriter writer, Object value, DataType type)
     {
        String result;
  
        if (type == DataType.DATE)
        {
           result = printExtendedAttributeDate((Date) value);
        }
        else
        {
           if (value instanceof Boolean)
           {
              result = printExtendedAttributeBoolean((Boolean) value);
           }
           else
           {
              if (value instanceof Duration)
              {
                 result = printDuration(writer, (Duration) value);
              }
              else
              {
                 if (type == DataType.CURRENCY)
                 {
                    result = printExtendedAttributeCurrency((Number) value);
                 }
                 else
                 {
                    if (value instanceof Number)
                    {
                       result = printExtendedAttributeNumber((Number) value);
                    }
                    else
                    {
                       result = value.toString();
                    }
                 }
              }
           }
        }
  
        return (result);
     }
docs: Print an extended attribute value.
  
  @param writer parent MSPDIWriter instance
  @param value attribute value
  @param type type of the value being passed
  @return string representation