lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael J. Primeaux" <>
Subject RE: [jira] Created: (LUCENENET-45) CultureInfo VS Formats
Date Thu, 28 Jun 2007 10:32:35 GMT

I would need a bit more context as to the problem domain but by default you should consider
using the current thread's UI culture, which would change the below code to be:

fms = (float) System.Single.Parse(fuzzySlop.image.Substring(1), Thread.CurrentThread.CurrentUICulture);

Also, I see you are casting to a float; why not just use float.Parse(...)? 


-----Original Message-----
From: David Kallesen (JIRA) [] 
Sent: Thursday, June 28, 2007 3:04 AM
Subject: [jira] Created: (LUCENENET-45) CultureInfo VS Formats

CultureInfo VS Formats

                 Key: LUCENENET-45
             Project: Lucene.Net
          Issue Type: Bug
         Environment: .NET 2.0
            Reporter: David Kallesen
            Priority: Trivial

When using System.Single.Parse(value) we should thing on "." vs ",".


fms = (float) System.Single.Parse(fuzzySlop.image.Substring(1));

should be changes to something like:

fms = (float) System.Single.Parse(fuzzySlop.image.Substring(1), new System.Globalization.CultureInfo("en-US"));

// David

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message