[poincare] PrintFloat: take into account the distinction between char

and glyph length in ConvertFloatToText
This commit is contained in:
Émilie Feral
2019-09-25 17:31:30 +02:00
committed by LeaNumworks
parent d6ad694b76
commit 4d593a6149
37 changed files with 153 additions and 124 deletions

View File

@@ -124,7 +124,7 @@ void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, in
willDisplayCellAtLocationWithDisplayMode(cell, i, j, Preferences::sharedPreferences()->displayMode());
// The cell is not a title cell and not editable
if (typeAtLocation(i,j) == k_notEditableValueCellType) {
constexpr int bufferSize = 2*PrintFloat::bufferSizeForFloatsWithPrecision(Preferences::LargeNumberOfSignificantDigits)+3;
constexpr int bufferSize = 2*PrintFloat::charSizeForFloatsWithPrecision(Preferences::LargeNumberOfSignificantDigits)+3;
char buffer[bufferSize]; // The largest buffer holds (-1.234567E-123;-1.234567E-123)
// Special case: last row
if (j == numberOfElementsInColumn(i) + 1) {