[apps/statisctics] Adjust to display mode to preferences

Change-Id: I744cb8e88fd2c5d14bf4c288037762b8f3a8fa8c
This commit is contained in:
Émilie Feral
2017-01-31 16:34:27 +01:00
parent b3a2114417
commit dd4d6c4936
3 changed files with 12 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
#include "box_controller.h"
#include "../apps_container.h"
#include <math.h>
namespace Statistics {
@@ -68,7 +69,8 @@ void BoxController::reloadBannerView() {
CalculPointer calculationMethods[5] = {&Store::minValue, &Store::firstQuartile, &Store::median, &Store::thirdQuartile,
&Store::maxValue};
float calculation = (m_store->*calculationMethods[(int)m_view.selectedQuantile()])();
Float(calculation).convertFloatToText(buffer, Float::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits);
AppsContainer * container = (AppsContainer *)app()->container();
Float(calculation).convertFloatToText(buffer, Float::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, container->preferences()->displayMode());
m_boxBannerView.setLegendAtIndex(buffer, 1);
}