Skip to content

Commit

Permalink
repair parsing and output in trace
Browse files Browse the repository at this point in the history
  • Loading branch information
gfobe committed Sep 14, 2012
1 parent 44ae46a commit fe18d99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Trace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ public void setFrequency(string frequency) {
throw new EmotionMLException("illegal format of frequency string");
}

this.Frequency = double.Parse(matches.GetEnumerator().Current.ToString());
string number = matches[0].Groups[1].Value;
this.Frequency = double.Parse(number, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
}

/// <summary>
Expand Down Expand Up @@ -152,8 +153,8 @@ public XmlDocument ToDom()
XmlDocument trace = new XmlDocument();

XmlElement traceTag = trace.CreateElement("trace");
traceTag.AppendChild(createAttributeWithValue(trace, "freq", getFrequency()));
traceTag.AppendChild(createAttributeWithValue(trace, "samples", samples));
traceTag.Attributes.Append(createAttributeWithValue(trace, "freq", getFrequency()));
traceTag.Attributes.Append(createAttributeWithValue(trace, "samples", samples));
trace.AppendChild(traceTag);

return trace;
Expand Down

0 comments on commit fe18d99

Please sign in to comment.