-Added support for serializing custom IConvertible values
-Refactored away dependency on IConvertible
This commit is contained in:
@@ -621,9 +621,7 @@ namespace Newtonsoft.Json
|
||||
if (Value != null)
|
||||
{
|
||||
string s;
|
||||
if (ConvertUtils.IsConvertible(Value))
|
||||
s = ConvertUtils.ToConvertible(Value).ToString(Culture);
|
||||
else if (Value is IFormattable)
|
||||
if (Value is IFormattable)
|
||||
s = ((IFormattable)Value).ToString(null, Culture);
|
||||
else
|
||||
s = Value.ToString();
|
||||
|
||||
Reference in New Issue
Block a user