diff --git a/core/enums.h b/core/enums.h index 65adf26..14dec69 100644 --- a/core/enums.h +++ b/core/enums.h @@ -9,6 +9,7 @@ class CORESHARED_EXPORT Enums : public QObject Q_OBJECT Q_ENUMS(VatType) + Q_ENUMS(Rounding) public: enum VatType @@ -19,6 +20,14 @@ public: SECOND_LOWER }; + enum Rounding + { + R_NONE, + R_UP, + R_DOWN, + R_MATH + }; + Enums() { } diff --git a/core/settingsservice.h b/core/settingsservice.h index 15aa258..45dcb4b 100644 --- a/core/settingsservice.h +++ b/core/settingsservice.h @@ -8,6 +8,7 @@ #include #include +#include #include "data/system.h" #include "service.h" @@ -50,8 +51,19 @@ public: { QDecDouble dec(TO_DEC(varVal.toInt())); varVal = QVariant::fromValue(dec); + objSettings->setProperty(propName, varVal); + continue; + } + + // all other numbers are int + if (varVal.toInt() > 0) + { + objSettings->setProperty(propName, varVal.toInt()); + } + else + { + objSettings->setProperty(propName, varVal); } - objSettings->setProperty(propName, varVal); } return settingsObj;