diff --git a/PROMS/XYPlots/XYPlots.cs b/PROMS/XYPlots/XYPlots.cs index 01b4fa91..34cce13a 100644 --- a/PROMS/XYPlots/XYPlots.cs +++ b/PROMS/XYPlots/XYPlots.cs @@ -397,6 +397,18 @@ namespace XYPlots string ystr = xystr[1]; if (ystr.EndsWith(".0")) // bug fix B2012-169, the Trim converted a ".75" value to a "75.0" value ystr = ystr.Trim(trimEndDot); + // count the number of '.', if there are two and the last char is a '.', trim it (this was causing + // a crash in CAL-OTO-OTO-BG-00001. This was done this way so as to be very specific to the + // problem found in Callaway, i.e. didn't want to break something else. + int cnt = 0; + int indx = ystr.IndexOf("."); + while (indx >= 0) + { + cnt++; + indx = indx+1==ystr.Length?-1:ystr.IndexOf(".", indx + 1); + } + if (cnt > 1) ystr = ystr.TrimEnd(trimEndDot); + y = double.Parse(ystr); if (doLOG10[flag, X]) retval.xyValue[X] = (int)(Offset[flag, X] + Scale[flag, X] * Math.Log10(x) + .5);