You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Morten Gorm Madsen (JIRA)" <ji...@apache.org> on 2013/12/18 09:44:07 UTC

[jira] [Created] (LUCENENET-533) StringValue of NumberField is localized

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)