initialize precision as well (related to #514)

This commit is contained in:
John
2022-02-13 12:21:41 +01:00
parent 3c4063b54e
commit f1cac3c487
+2 -2
View File
@@ -747,7 +747,7 @@ result_t NumberDataType::readSymbols(size_t offset, size_t length, const SymbolS
result_t NumberDataType::readFromRawValue(size_t length, unsigned int value,
OutputFormat outputFormat, ostream* output) const {
int signedValue;
*output << defaultfloat << setw(0) << dec; // initialize output
*output << defaultfloat << setw(0) << dec << setprecision(0); // initialize output
if (!hasFlag(REQ) && value == m_replacement) {
if (outputFormat & OF_JSON) {
@@ -836,7 +836,7 @@ result_t NumberDataType::readFromRawValue(size_t length, unsigned int value,
signedValue = static_cast<int>(value);
}
if (m_divisor < 0) {
*output << fixed << setprecision(0)
*output << fixed
<< (static_cast<float>(signedValue) * static_cast<float>(-m_divisor));
} else if (m_divisor <= 1) {
if (hasFlag(FIX) && hasFlag(BCD)) {