Parsing of double fails for some locals


If the WITSML document contains floating point literals and the local settings is using "," instead of "." as decimal mark, nWitsml will fail to parse it. See http://en.wikipedia.org/wiki/Decimal_separator for more information about decimal mark.
    public void TestGetAllCurves()
        WitsmlServer server = CreateWitsmlServer();
        WitsmlWellbore wellbore = server.getOne<WitsmlWellbore>(new WitsmlQuery(), "B-1458461", "W-1458461");
        WitsmlQuery query = new WitsmlQuery();
        query.addElementConstraint("startDateTimeIndex", "2011-05-17T12:00:00+02:00");
        query.addElementConstraint("endDateTimeIndex", "2011-05-17T12:03:00+02:00");
        query.addElementConstraint("mnemonic", "TIME");
        query.addElementConstraint("mnemonic", "GS_BPOS");
        query.addElementConstraint("mnemonic", "GS_HKLD");
        WitsmlLog log = server.getOne<WitsmlLog>(query, "L-1594991-Time", wellbore);
        foreach (var curve in log.getCurves())
            IEnumerable<string> values = curve.getValues().Select(v => { return FormatValue(v); });
            Console.Out.WriteLine(string.Join(", ", values));


boomhauer wrote Aug 24, 2011 at 4:24 PM

I'm assuming the server is returning numbers formatted in US Invarient format, is this correct? If so, you'll want to make sure your process is using invarient for parsing numerical values, but you can then use local regional formatting when displaying them.

wrote Feb 14, 2013 at 12:45 AM