-Added support for serializing custom IConvertible values

-Refactored away dependency on IConvertible
This commit is contained in:
James Newton-King
2013-04-01 12:38:45 +13:00
parent 08c7055d91
commit b5e7005735
17 changed files with 704 additions and 957 deletions
+1 -3
View File
@@ -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();