Fixed saving of QDecDouble numbers.

master
Josef Rokos 7 years ago
parent 5ebea2f7c9
commit 8e7137f3bb

@ -10,8 +10,8 @@
#define PERM_DELETE "DELETE" #define PERM_DELETE "DELETE"
#define DEC_MULTIPLE 100 #define DEC_MULTIPLE 100
#define TO_DEC(num) QDecDouble((double)num / DEC_MULTIPLE) #define TO_DEC(num) (QDecDouble(num) / QDecDouble(DEC_MULTIPLE))
#define FROM_DEC(num) num.toDouble() * DEC_MULTIPLE #define FROM_DEC(num) (num * QDecDouble(DEC_MULTIPLE)).toInt32()
#ifndef PLUGIN_ROOT #ifndef PLUGIN_ROOT
#ifdef _WIN32 #ifdef _WIN32

@ -154,6 +154,10 @@ class QDECIMAL_EXPORT QDecDouble
double toDouble() const; double toDouble() const;
int32_t toInt32(QDecContext* c = 0) const {
return decDoubleToInt32(&m_data, CXT(c), DEC_ROUND_HALF_UP);
}
QByteArray toEngString() const { QByteArray toEngString() const {
char str[MaxStrSize] = { 0 }; char str[MaxStrSize] = { 0 };
return decDoubleToEngString(&m_data, str); return decDoubleToEngString(&m_data, str);

Loading…
Cancel
Save