From dba9912bbedd19f9057546928d24fa9bc6721aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 3 Sep 2019 15:40:16 +0200 Subject: [PATCH] [apps/graph] ListParameterController: display only 2 significant digits on the definition domain --- apps/graph/list/list_parameter_controller.cpp | 4 ++-- poincare/include/poincare/preferences.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/graph/list/list_parameter_controller.cpp b/apps/graph/list/list_parameter_controller.cpp index 8e63fdeda..ada6f923d 100644 --- a/apps/graph/list/list_parameter_controller.cpp +++ b/apps/graph/list/list_parameter_controller.cpp @@ -52,9 +52,9 @@ void ListParameterController::willDisplayCellForIndex(HighlightCell * cell, int m_functionDomain.setMessage(I18n::Message::FunctionDomain); constexpr int bufferSize = BufferTextView::k_maxNumberOfChar; char buffer[bufferSize]; - int numberOfChar = PoincareHelpers::ConvertFloatToText(function->tMin(), buffer, bufferSize, Preferences::ShortNumberOfSignificantDigits); + int numberOfChar = PoincareHelpers::ConvertFloatToText(function->tMin(), buffer, bufferSize, Preferences::VeryShortNumberOfSignificantDigits); numberOfChar += strlcpy(buffer+numberOfChar, "..", bufferSize-numberOfChar); - numberOfChar += PoincareHelpers::ConvertFloatToText(function->tMax(), buffer+numberOfChar, bufferSize-numberOfChar, Preferences::ShortNumberOfSignificantDigits); + numberOfChar += PoincareHelpers::ConvertFloatToText(function->tMax(), buffer+numberOfChar, bufferSize-numberOfChar, Preferences::VeryShortNumberOfSignificantDigits); numberOfChar += strlcpy(buffer+numberOfChar, " ", bufferSize-numberOfChar); m_functionDomain.setAccessoryText(buffer); } diff --git a/poincare/include/poincare/preferences.h b/poincare/include/poincare/preferences.h index aa4f1cbb8..f7fa2d3c3 100644 --- a/poincare/include/poincare/preferences.h +++ b/poincare/include/poincare/preferences.h @@ -10,6 +10,7 @@ public: constexpr static int LargeNumberOfSignificantDigits = 7; constexpr static int MediumNumberOfSignificantDigits = 5; constexpr static int ShortNumberOfSignificantDigits = 4; + constexpr static int VeryShortNumberOfSignificantDigits = 2; enum class EditionMode { Edition2D,