mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] PrintFloat: take into account the distinction between char
and glyph length in ConvertFloatToText
This commit is contained in:
committed by
LeaNumworks
parent
d6ad694b76
commit
4d593a6149
@@ -51,12 +51,12 @@ void BoxController::reloadBannerView() {
|
||||
// Set calculation result
|
||||
assert(UTF8Decoder::CharSizeOfCodePoint(' ') == 1);
|
||||
constexpr int precision = Preferences::LargeNumberOfSignificantDigits;
|
||||
constexpr int bufferSize = PrintFloat::bufferSizeForFloatsWithPrecision(precision) + 1;
|
||||
constexpr int bufferSize = PrintFloat::charSizeForFloatsWithPrecision(precision) + 1;
|
||||
char buffer[bufferSize];
|
||||
CalculPointer calculationMethods[5] = {&Store::minValue, &Store::firstQuartile, &Store::median, &Store::thirdQuartile,
|
||||
&Store::maxValue};
|
||||
double calculation = (m_store->*calculationMethods[selectedQuantile])(selectedSeriesIndex());
|
||||
int numberOfChar = PoincareHelpers::ConvertFloatToText<double>(calculation, buffer, bufferSize - 1, precision);
|
||||
int numberOfChar = PoincareHelpers::ConvertFloatToText<double>(calculation, buffer, bufferSize, precision);
|
||||
buffer[numberOfChar++] = ' ';
|
||||
assert(numberOfChar <= bufferSize - 1);
|
||||
buffer[numberOfChar] = 0;
|
||||
|
||||
Reference in New Issue
Block a user