|
|
|
@ -596,7 +596,7 @@ int FactMetaData::decimalPlaces(void) const
@@ -596,7 +596,7 @@ int FactMetaData::decimalPlaces(void) const
|
|
|
|
|
int incrementDecimalPlaces = unknownDecimalPlaces; |
|
|
|
|
|
|
|
|
|
// First determine decimal places from increment
|
|
|
|
|
double increment = this->increment(); |
|
|
|
|
double increment = _rawTranslator(this->increment()).toDouble(); |
|
|
|
|
if (!qIsNaN(increment)) { |
|
|
|
|
double integralPart; |
|
|
|
|
|
|
|
|
@ -614,7 +614,16 @@ int FactMetaData::decimalPlaces(void) const
@@ -614,7 +614,16 @@ int FactMetaData::decimalPlaces(void) const
|
|
|
|
|
if (incrementDecimalPlaces != unknownDecimalPlaces && _decimalPlaces == unknownDecimalPlaces) { |
|
|
|
|
actualDecimalPlaces = incrementDecimalPlaces; |
|
|
|
|
} else { |
|
|
|
|
actualDecimalPlaces = qMax(_decimalPlaces, incrementDecimalPlaces); |
|
|
|
|
|
|
|
|
|
int settingsDecimalPlaces = _decimalPlaces; |
|
|
|
|
double ctest = _rawTranslator(1.0).toDouble(); |
|
|
|
|
|
|
|
|
|
settingsDecimalPlaces += -log10(ctest); |
|
|
|
|
|
|
|
|
|
settingsDecimalPlaces = qMin(25, settingsDecimalPlaces); |
|
|
|
|
settingsDecimalPlaces = qMax(0, settingsDecimalPlaces); |
|
|
|
|
|
|
|
|
|
actualDecimalPlaces = qMax(settingsDecimalPlaces, incrementDecimalPlaces); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return actualDecimalPlaces; |
|
|
|
|