mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] EditableCellTableViewController: adjust column width to be
able to display float like "-1.234567E-123"
This commit is contained in:
committed by
LeaNumworks
parent
501f7ed8af
commit
d6ad694b76
@@ -124,13 +124,14 @@ 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) {
|
||||
char buffer[2*PrintFloat::bufferSizeForFloatsWithPrecision(Preferences::LargeNumberOfSignificantDigits)+3];//(??;??)
|
||||
constexpr int bufferSize = 2*PrintFloat::bufferSizeForFloatsWithPrecision(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) {
|
||||
buffer[0] = 0;
|
||||
} else {
|
||||
double x = intervalAtColumn(i)->element(j-1);
|
||||
printEvaluationOfAbscissaAtColumn(x, i, buffer, cellBufferSize(i));
|
||||
printEvaluationOfAbscissaAtColumn(x, i, buffer, bufferSize);
|
||||
}
|
||||
static_cast<EvenOddBufferTextCell *>(cell)->setText(buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user