internal string GetFormattedString()
{
switch (JsonType)
{
case JsonType.String:
if (value is string || value == null)
return (string)value;
throw new NotImplementedException("GetFormattedString from value type " + value.GetType());
case JsonType.Number:
return ((IFormattable)value).ToString("G", NumberFormatInfo.InvariantInfo);
default:
throw new InvalidOperationException();
}
}
}