Bug 4415 - JsonValue Parse cannot read exponent format numbers
Summary: JsonValue Parse cannot read exponent format numbers
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
Depends on:
Reported: 2012-04-12 20:27 UTC by adam.j.davidson
Modified: 2012-04-13 19:20 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description adam.j.davidson 2012-04-12 20:27:45 UTC
In this example test "4.25987E-06" is parsed into the JsonValue 0.425987.

public void TestFloatExp() 
    var f = 4.25987E-06f;
    var s = f.ToString();
    var v = JsonValue.Parse(s);
    // JsonValue number exponent is incorrectly parsed
    Assert.That(v == f, "expected "+f+", result was "+v.ToString());

I'm using the System.Json.dll that comes with MonoTouch 5.2.10.
Comment 1 Sebastien Pouliot 2012-04-12 21:42:18 UTC
ouch, confirmed
Comment 2 Sebastien Pouliot 2012-04-13 09:33:05 UTC
mono-2-10: f1b6f91b8ec24e3039e45963c032694b1cad4248
monotouch master: 541bcd5becf067b40511b7cc7f69e9e7bf58cd0d
monotouch 5.2-series: 3bd6d48da6e84684b0eeec9ae6eb91391af533f0

QA: unit test added in monotouch (both branches)
Comment 3 Sebastien Pouliot 2012-04-13 19:20:57 UTC
also fixed in (mono) master: b5573f22dea31a8f9073e7cb36699f3cb717fd7f

The old System.Json was replaced but the fix is required in S.SM.Web.dll (so it's still needed)