[apps] Display Engineering notation in title bar

This commit is contained in:
Léa Saviot
2019-09-24 11:44:46 +02:00
committed by EmilieNumworks
parent 2c11192b2a
commit 2686b0d51d
6 changed files with 23 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ Deg = "gra"
Deviation = "Varianz"
DisplayValues = "Werte anzeigen"
Empty = "Leer"
Eng = "tech"
ExitExamMode1 = "Möchten Sie den Testmodus "
ExitExamMode2 = "verlassen?"
Exponential = "Exponentielle"
@@ -51,7 +52,7 @@ PoolMemoryFull2 = "Versuchen Sie es erneut."
Rad = "rad"
Rename = "Umbenennen"
RoundAbscissa = "Ganzzahl"
Sci = "sci/"
Sci = "sci"
SquareSum = "Quadratsumme"
StatTab = "Stats"
StandardDeviation = "Standardabweichung"

View File

@@ -14,6 +14,7 @@ Deg = "deg"
Deviation = "Variance"
DisplayValues = "Display values"
Empty = "Empty"
Eng = "eng"
ExitExamMode1 = "Exit the exam "
ExitExamMode2 = "mode?"
Exponential = "Exponential"
@@ -51,7 +52,7 @@ PoolMemoryFull2 = "Try again."
Rad = "rad"
Rename = "Rename"
RoundAbscissa = "Integer"
Sci = "sci/"
Sci = "sci"
SquareSum = "Sum of squares"
StandardDeviation = "Standard deviation"
StoreExpressionNotAllowed = "'store' is not allowed"

View File

@@ -14,6 +14,7 @@ Deg = "gra"
Deviation = "Varianza"
DisplayValues = "Visualizar los valores"
Empty = "Vacio"
Eng = "ing"
ExitExamMode1 = "Salir del modo "
ExitExamMode2 = "examen ?"
Exponential = "Exponencial"
@@ -51,7 +52,7 @@ PoolMemoryFull2 = "Intente de nuevo."
Rad = "rad"
Rename = "Renombrar"
RoundAbscissa = "Abscisas enteras"
Sci = "sci/"
Sci = "sci"
SquareSum = "Suma cuadrados"
StandardDeviation = "Desviación típica"
StatTab = "Medidas"

View File

@@ -14,6 +14,7 @@ Deg = "deg"
Deviation = "Variance"
DisplayValues = "Afficher les valeurs"
Empty = "Vide"
Eng = "ing"
ExitExamMode1 = "Voulez-vous sortir "
ExitExamMode2 = "du mode examen ?"
Exponential = "Exponentielle"
@@ -51,7 +52,7 @@ PoolMemoryFull2 = "Réessayez."
Rad = "rad"
Rename = "Renommer"
RoundAbscissa = "Abscisses entières"
Sci = "sci/"
Sci = "sci"
SquareSum = "Somme des carrés"
StandardDeviation = "Écart type"
StatTab = "Stats"

View File

@@ -14,6 +14,7 @@ Deg = "gra"
Deviation = "Variancia"
DisplayValues = "Exibir os valores"
Empty = "Vácuo"
Eng = "eng"
ExitExamMode1 = "Você quer sair do modo de "
ExitExamMode2 = "exame ?"
Exponential = "Exponencial"
@@ -51,7 +52,7 @@ PoolMemoryFull2 = "Tente novamente."
Rad = "rad"
Rename = "Renomear"
RoundAbscissa = "Inteiro"
Sci = "sci/"
Sci = "sci"
SquareSum = "Soma dos quadrados"
StandardDeviation = "Desvio padrão"
StatTab = "Estat"

View File

@@ -85,8 +85,19 @@ void TitleBarView::refreshPreferences() {
char buffer[bufferSize];
int numberOfChar = 0;
Preferences * preferences = Preferences::sharedPreferences();
if (preferences->displayMode() == Preferences::PrintFloatMode::Scientific) {
numberOfChar += strlcpy(buffer, I18n::translate(I18n::Message::Sci), bufferSize);
{
// Display Sci/ or Eng/ if the print float mode is not decimal
const Preferences::PrintFloatMode printFloatMode = preferences->displayMode();
if (printFloatMode != Preferences::PrintFloatMode::Decimal) {
// Check that there is no new print float mode, otherwise add its message
assert(printFloatMode == Preferences::PrintFloatMode::Scientific
|| printFloatMode == Preferences::PrintFloatMode::Engineering);
I18n::Message printMessage = printFloatMode == Preferences::PrintFloatMode::Scientific ? I18n::Message::Sci : I18n::Message::Eng;
numberOfChar += strlcpy(buffer, I18n::translate(printMessage), bufferSize);
assert(numberOfChar < bufferSize-1);
assert(UTF8Decoder::CharSizeOfCodePoint('/') == 1);
buffer[numberOfChar++] = '/';
}
}
assert(numberOfChar <= bufferSize);
if (preferences->angleUnit() == Preferences::AngleUnit::Radian) {