Morten Gorm Madsen created LUCENENET-533:
--------------------------------------------

             Summary: StringValue of NumberField is localized
                 Key: LUCENENET-533
                 URL: https://issues.apache.org/jira/browse/LUCENENET-533
             Project: Lucene.Net
          Issue Type: Bug
          Components: Lucene.Net Core
    Affects Versions: Lucene.Net 3.0.3, Lucene.Net 3.6, Lucene.Net 4.0
            Reporter: Morten Gorm Madsen
            Priority: Minor


The StringValue property of Lucene.Net.Documents.NumericField returns a 
localized string value (ie. confusion about the decimal separation character). 
IMHO it should be a following the invariant culture whenever possible.

Suggested fix:

public override string StringValue
{
  get {
    if (fieldsData == null)
      return null;

    if (fieldsData is IConvertible)
      return ((IConvertible)fieldsData).ToString(CultureInfo.InvariantCulture);
    
    return fieldsData.ToString();
  }
}



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to