Fix rendering of Unit::ThermalConductivity

The old behaviour was:
>>> Quantity('0.9 W/m/K').UserString
u'0.00 W/mm/K'
>>> Quantity('1.1 W/m/K').UserString
u'1.10 W/m/K'
>>> Quantity('1100 W/m/K').UserString
u'1100.00 W/m/K'

The new behaviour is:
>>> Quantity('0.9 W/m/K').UserString
u'0.90 W/m/K'
>>> Quantity('1.1 W/m/K').UserString
u'1.10 W/m/K'
>>> Quantity('1100 W/m/K').UserString
u'1.10 W/mm/K'
This commit is contained in:
Harald Geyer
2017-10-10 11:17:59 +00:00
committed by wmayer
parent f3912f60b9
commit f50a19df2f
2 changed files with 2 additions and 2 deletions

View File

@@ -114,7 +114,7 @@ QString UnitsSchemaInternal::schemaTranslate(const Quantity &quant, double &fact
}
}
else if (unit == Unit::ThermalConductivity) {
if (UnitValue < 1000) {
if (UnitValue > 1000000) {
unitString = QString::fromLatin1("W/mm/K");
factor = 1000000.0;
}

View File

@@ -143,7 +143,7 @@ QString UnitsSchemaMKS::schemaTranslate(const Quantity &quant, double &factor, Q
}
}
else if (unit == Unit::ThermalConductivity) {
if (UnitValue < 1000) {
if (UnitValue > 1000000) {
unitString = QString::fromLatin1("W/mm/K");
factor = 1000000.0;
}