public void Add(string format, string rdfPredicate) { var from = WikiApiUtils.SingularValue <float>(_printouts, rdfPredicate, 0); if (from.AlmostEquals(0, 0.001)) // stats don't use many decimal places { return; } _properties.Add(string.Format(CultureInfo.InvariantCulture, format, from)); }
public void Add(string name, string rdfPredicateFrom, string rdfPredicateTo) { var from = WikiApiUtils.SingularValue <float>(_printouts, rdfPredicateFrom, 0); var to = WikiApiUtils.SingularValue <float>(_printouts, rdfPredicateTo, 0); if (from.AlmostEquals(0, 0.001) && to.AlmostEquals(0, 0.001)) // stats don't use many decimal places { return; } _properties.Add(new XmlStat { Name = name, From = new[] { @from }, To = new[] { to } }); }