lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten Gorm Madsen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LUCENENET-533) StringValue of NumberField is localized
Date Wed, 18 Dec 2013 08:44:07 GMT
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)

Mime
View raw message