mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Implement value(v, metric) for UserMetric
It needs to be overriden like value(metric)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user