private static string handleOtherFormats(string format, object arg, IFormatProvider culture)
{
try
{
IFormattable obj = arg as IFormattable;
if (obj != null)
{
return obj.ToString(format, culture);
}
else if (arg != null)
{
return arg.ToString();
}
}
catch (FormatException e)
{
throw new FormatException(String.Format("The format of '{0}' is invalid.", format), e);
}
return String.Empty;
}