initialize precision as well (related to #514)
This commit is contained in:
@@ -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,
|
result_t NumberDataType::readFromRawValue(size_t length, unsigned int value,
|
||||||
OutputFormat outputFormat, ostream* output) const {
|
OutputFormat outputFormat, ostream* output) const {
|
||||||
int signedValue;
|
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 (!hasFlag(REQ) && value == m_replacement) {
|
||||||
if (outputFormat & OF_JSON) {
|
if (outputFormat & OF_JSON) {
|
||||||
@@ -836,7 +836,7 @@ result_t NumberDataType::readFromRawValue(size_t length, unsigned int value,
|
|||||||
signedValue = static_cast<int>(value);
|
signedValue = static_cast<int>(value);
|
||||||
}
|
}
|
||||||
if (m_divisor < 0) {
|
if (m_divisor < 0) {
|
||||||
*output << fixed << setprecision(0)
|
*output << fixed
|
||||||
<< (static_cast<float>(signedValue) * static_cast<float>(-m_divisor));
|
<< (static_cast<float>(signedValue) * static_cast<float>(-m_divisor));
|
||||||
} else if (m_divisor <= 1) {
|
} else if (m_divisor <= 1) {
|
||||||
if (hasFlag(FIX) && hasFlag(BCD)) {
|
if (hasFlag(FIX) && hasFlag(BCD)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user