Exemplo n.º 1
0
        public List <string> AsString()
        {
            string value;
            string zscore;
            int    rounding;

            if (Empty)
            {
                return(new List <string> {
                    Name,
                    "",
                    "",
                    ""
                });
            }

            if (UnitShorthand.Equals("mmHg") ||
                UnitShorthand.Equals("cm/s") ||
                UnitShorthand.Equals("m/s"))
            {
                rounding = 1;
            }
            else
            {
                rounding = 2;
            }
            value = Math.Round(Value, rounding).ToString();

            if (ZScoreable)
            {
                zscore = ZScore.ToString("N2");
            }
            else
            {
                zscore = "";
            }

            return(new List <string> {
                Name,
                value,
                UnitShorthand,
                zscore
            });
        }
Exemplo n.º 2
0
        public string ReportString(bool includeZScore = true, bool includeComment = true)
        {
            string name;
            string value;
            string Zscorestring = "";

            if (HasComment && includeComment)
            {
                if (AnomalyText.Length == 0)
                {
                    return("");
                }
                name = AnomalyText;
            }
            else
            {
                name = Name;
            }

            if (UnitShorthand.Equals("mmHg") ||
                UnitShorthand.Equals("cm/s") ||
                UnitShorthand.Equals("m/s"))
            {
                value = Math.Round(Value, 1).ToString();
            }
            else
            {
                value = Math.Round(Value, 2).ToString();
            }

            if (ZScoreable && includeZScore)
            {
                Zscorestring = ", Z-score=" + ZScore.ToString("N2");
            }
            return(name + " (" + value + " " + UnitShorthand + Zscorestring + ")");
        }