Skip to content

Commit

Permalink
Merge pull request #7 from tschoening/locale_fixes
Browse files Browse the repository at this point in the history
Locale fixes
  • Loading branch information
ppalucha authored Nov 2, 2017
2 parents e73233f + fff2e55 commit 4e60828
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/net/atomique/ksar/Graph/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.awt.Color;
import java.io.File;
import java.io.IOException;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -96,11 +97,12 @@ private void create_DataStore() {

public int parse_line(Second now, String s) {
String[] cols = s.split("\\s+");
Double colvalue = null;
Number colvalue = null;
NumberFormat nf = NumberFormat.getInstance();
//System.out.println("graph parsing:" + s);
for (int i = skipColumn; i < HeaderStr.length; i++) {
try {
colvalue = new Double(cols[i]);
colvalue = nf.parse(cols[i]);
} catch (NumberFormatException ne) {
System.out.println(graphtitle + " " + cols[i] + " is NaN");
return 0;
Expand All @@ -110,12 +112,12 @@ public int parse_line(Second now, String s) {
return 0;
}

add_datapoint_plot(now, i-skipColumn , HeaderStr[i-skipColumn], colvalue);
add_datapoint_plot(now, i-skipColumn , HeaderStr[i-skipColumn], colvalue.doubleValue());


TimeTableXYDataset tmp = StackListbyCol.get(HeaderStr[i]);
if (tmp != null) {
add_datapoint_stack(tmp, now, i , HeaderStr[i], colvalue);
add_datapoint_stack(tmp, now, i , HeaderStr[i], colvalue.doubleValue());
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/net/atomique/ksar/Parser/Linux.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public int parse(String line, String[] columns) {
int seconde = 0;
Second now = null;

if ("Average:".equals(columns[0])) {
// Test for "Average:" in different locales, like "Durchschnitt:":
if (columns[0].matches("(?i)^[a-z]+:")) {
currentStat = "NONE";
return 0;
}
Expand Down

0 comments on commit 4e60828

Please sign in to comment.