Skip to content

Commit

Permalink
LUCENENET-533 StringValue of NumberField is localized
Browse files Browse the repository at this point in the history
  • Loading branch information
synhershko committed Feb 21, 2014
1 parent b568cb5 commit e3beba7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/Document/NumericField.cs
Expand Up @@ -16,6 +16,7 @@
*/

using System;
using System.Globalization;
using System.IO;
using Lucene.Net.Search;
using NumericTokenStream = Lucene.Net.Analysis.NumericTokenStream;
Expand Down Expand Up @@ -230,7 +231,13 @@ public override TextReader ReaderValue
/// <summary>Returns the numeric value as a string (how it is stored, when <see cref="Field.Store.YES" /> is chosen). </summary>
public override string StringValue
{
get { return (fieldsData == null) ? null : fieldsData.ToString(); }
get
{
if (fieldsData == null) return null;
var fd = fieldsData as IConvertible;
if (fd != null) return fd.ToString(CultureInfo.InvariantCulture);
return fieldsData.ToString();
}
}

/// <summary>Returns the current numeric value as a subclass of <see cref="Number" />, <c>null</c> if not yet initialized. </summary>
Expand Down

0 comments on commit e3beba7

Please sign in to comment.