Implement value(v, metric) for UserMetric

It needs to be overriden like value(metric)
This commit is contained in:
Ale Martinez
2021-02-23 18:13:03 -03:00
parent cf31bffed2
commit b44be0897d
2 changed files with 11 additions and 0 deletions

View File

@@ -302,6 +302,9 @@ public:
// Get the value and apply conversion if needed
double value(bool metric) const;
// Apply conversion if needed to the supplied value
double value(double v, bool metric) const;
// for averages the count of items included in the average
double count() const;

View File

@@ -164,6 +164,14 @@ UserMetric::value(bool metric) const
else return (value() * conversion()) + conversionSum();
}
// Apply conversion if needed to the supplied value
double
UserMetric::value(double v, bool metric) const
{
if (metric) return v;
else return (v * conversion()) + conversionSum();
}
// for averages the count of items included in the average
double
UserMetric::count() const