#3082 Statistics. Further fixes regarding P10 and P90 labels

This commit is contained in:
Bjørn Erik Jensen
2018-06-26 11:29:05 +02:00
parent 155329b4fc
commit b0355471b4
4 changed files with 29 additions and 6 deletions

View File

@@ -25,9 +25,25 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const QString RiaStatisticsTools::percentileToPValueText(const QString& percentile)
const QString RiaStatisticsTools::replacePercentileByPValueText(const QString& percentile)
{
if (percentile == ENSEMBLE_STAT_P10_QUANTITY_NAME) return "P90";
if (percentile == ENSEMBLE_STAT_P90_QUANTITY_NAME) return "P10";
return percentile;
QString result = percentile;
if (result == ENSEMBLE_STAT_P10_QUANTITY_NAME)
{
result = ENSEMBLE_STAT_P90_QUANTITY_NAME;
}
else if (result == ENSEMBLE_STAT_P90_QUANTITY_NAME)
{
result = ENSEMBLE_STAT_P10_QUANTITY_NAME;
}
else if (percentile.contains(QString("%1:").arg(ENSEMBLE_STAT_P10_QUANTITY_NAME)))
{
result.replace(ENSEMBLE_STAT_P10_QUANTITY_NAME, ENSEMBLE_STAT_P90_QUANTITY_NAME);
}
else if (percentile.contains(QString("%1:").arg(ENSEMBLE_STAT_P90_QUANTITY_NAME)))
{
result.replace(ENSEMBLE_STAT_P90_QUANTITY_NAME, ENSEMBLE_STAT_P10_QUANTITY_NAME);
}
return result;
}