[apps/poincare] Move NormalDistribution to Poincare

This commit is contained in:
Léa Saviot
2019-08-23 10:44:40 +02:00
parent cf4413bbfa
commit 0840ca7a1e
39 changed files with 246 additions and 163 deletions

View File

@@ -1,6 +1,6 @@
#include "float_parameter_controller.h"
#include "../constant.h"
#include "../shared/poincare_helpers.h"
#include <poincare/preferences.h>
#include <assert.h>
#include <cmath>
@@ -108,8 +108,10 @@ void FloatParameterController::willDisplayCellForIndex(HighlightCell * cell, int
if (myCell->isEditing()) {
return;
}
char buffer[PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
PrintFloat::ConvertFloatToText<double>(parameterAtIndex(index), buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Preferences::PrintFloatMode::Decimal);
constexpr int precision = Preferences::LargeNumberOfSignificantDigits;
constexpr int bufferSize = PrintFloat::bufferSizeForFloatsWithPrecision(precision);
char buffer[bufferSize];
PrintFloat::ConvertFloatToText<double>(parameterAtIndex(index), buffer, bufferSize, precision, Preferences::PrintFloatMode::Decimal);
myCell->setAccessoryText(buffer);
}