restsharp/RestSharp — pull request #402 by pasho (2013-08-21 13:28:37+00:00)
Title: A hacky fix for the decimal parse error which happens for very small numbers like "0.00005557". There might be a better way of doing this.

...bers like "0.00005557"

A simple program which recreates the error:
using System;
using RestSharp;

namespace RestSharpJson
{
class Program
{
static void Main(string[] args)
{
var json = "{\"value\":0.00005557}";

var ds = new JsonDeserializer();

var resp = new RestResponse()
{
Content = json
};

var result = ds.Deserialize(resp);
Console.WriteLine(result.value);
Console.Read();
}

class Number
{
public decimal value { get; set; }
}
}
}

ConvertValue gets value as double already and it needs to convert it to decimal. To do that it transforms it to string. At this step our double value turns into this "5.557E-05". Decimal.Parse is unable to read it.