SOLR-3340: don't use number format of the default locale

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1310812 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-04-07 18:12:28 +00:00
parent 4b638a2903
commit 61ee8ef3ec
1 changed files with 3 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import java.net.URL;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
@ -241,9 +242,9 @@ public class SolrInfoMBeanHandler extends RequestHandlerBase {
.append(ref).append(", Now: ").append(now);
if(ref instanceof Number) {
NumberFormat nf = NumberFormat.getIntegerInstance();
NumberFormat nf = NumberFormat.getIntegerInstance(Locale.ENGLISH);
if((ref instanceof Double) || (ref instanceof Float)) {
nf = NumberFormat.getInstance();
nf = NumberFormat.getInstance(Locale.ENGLISH);
}
double diff = ((Number)now).doubleValue() - ((Number)ref).doubleValue();
str.append( ", Delta: ").append(nf.format(diff));