diff --git a/src/Base/UnitsSchemaImperial1.cpp b/src/Base/UnitsSchemaImperial1.cpp index 16d7bb580..cb226bcb3 100644 --- a/src/Base/UnitsSchemaImperial1.cpp +++ b/src/Base/UnitsSchemaImperial1.cpp @@ -55,7 +55,7 @@ using namespace Base; QString UnitsSchemaImperial1::schemaTranslate(Base::Quantity quant,double &factor,QString &unitString) { - double UnitValue = quant.getValue(); + double UnitValue = std::abs(quant.getValue()); Unit unit = quant.getUnit(); // for imperial user/programmer mind; UnitValue is in internal system, that means // mm/kg/s. And all combined units have to be calculated from there! @@ -115,5 +115,5 @@ QString UnitsSchemaImperial1::schemaTranslate(Base::Quantity quant,double &facto unitString = quant.getUnit().getString(); factor = 1.0; } - return QString::fromLatin1("%1 %2").arg(UnitValue / factor).arg(unitString); + return QString::fromLatin1("%1 %2").arg(quant.getValue() / factor).arg(unitString); } diff --git a/src/Base/UnitsSchemaInternal.cpp b/src/Base/UnitsSchemaInternal.cpp index 2408ff288..b9c212c49 100644 --- a/src/Base/UnitsSchemaInternal.cpp +++ b/src/Base/UnitsSchemaInternal.cpp @@ -36,7 +36,7 @@ using namespace Base; QString UnitsSchemaInternal::schemaTranslate(Base::Quantity quant,double &factor,QString &unitString) { - double UnitValue = quant.getValue(); + double UnitValue = std::abs(quant.getValue()); Unit unit = quant.getUnit(); // now do special treatment on all cases seams nececarry: @@ -97,6 +97,6 @@ QString UnitsSchemaInternal::schemaTranslate(Base::Quantity quant,double &factor unitString = quant.getUnit().getString(); factor = 1.0; } - return QString::fromUtf8("%1 %2").arg(UnitValue / factor).arg(unitString); + return QString::fromUtf8("%1 %2").arg(quant.getValue() / factor).arg(unitString); } diff --git a/src/Base/UnitsSchemaMKS.cpp b/src/Base/UnitsSchemaMKS.cpp index 532d32304..c9041e7c3 100644 --- a/src/Base/UnitsSchemaMKS.cpp +++ b/src/Base/UnitsSchemaMKS.cpp @@ -36,7 +36,7 @@ using namespace Base; QString UnitsSchemaMKS::schemaTranslate(Base::Quantity quant,double &factor,QString &unitString) { - double UnitValue = quant.getValue(); + double UnitValue = std::abs(quant.getValue()); Unit unit = quant.getUnit(); // now do special treatment on all cases seams nececarry: @@ -92,5 +92,5 @@ QString UnitsSchemaMKS::schemaTranslate(Base::Quantity quant,double &factor,QStr unitString = quant.getUnit().getString(); factor = 1.0; } - return QString::fromUtf8("%1 %2").arg(UnitValue / factor).arg(unitString); + return QString::fromUtf8("%1 %2").arg(quant.getValue() / factor).arg(unitString); }