public void DoublesGetRounded(double input, string expected) { var tested = new InvariantCultureRoundingFormat(); var result = tested.Format("", input, null); Assert.Equal(expected, result); }
public void StringsGetThroughWhenUsingAppendFormat(string input) { var tested = new InvariantCultureRoundingFormat(); var stb = new StringBuilder(); stb.AppendFormat(tested, "{0}", input); Assert.Equal(input.ToString(), stb.ToString()); }
public override string ToString() { var numericFormat = new InvariantCultureRoundingFormat(); var stb = new StringBuilder(); stb.AppendFormat(numericFormat, "μ={0}\t", Average); stb.AppendFormat(numericFormat, "Min={0}\t", Min); stb.AppendFormat(numericFormat, "Max={0}\t", Max); stb.AppendFormat(numericFormat, "∑={0}\t", Sum); stb.AppendFormat(numericFormat, "N={0}\t", N); stb.AppendFormat(numericFormat, "σ={0}\t", PopulationStandardDeviation); stb.AppendFormat(numericFormat, "σ²={0}\t", PopulationVariance); stb.AppendFormat(numericFormat, "SEM={0}", StandardError); return(stb.ToString()); }