add class QuantityFormat to control user string of Quantity
do some code refactoration to reduce duplicate code
This commit is contained in:
@@ -60,9 +60,5 @@ QString UnitsSchemaCentimeters::schemaTranslate(const Base::Quantity& quant, dou
|
||||
factor = 1.0;
|
||||
}
|
||||
|
||||
//return QString::fromUtf8("%L1 %2").arg(quant.getValue() / factor).arg(unitString);
|
||||
QLocale Lc = QLocale::system();
|
||||
Lc.setNumberOptions(Lc.OmitGroupSeparator | Lc.RejectGroupSeparator);
|
||||
QString Ln = Lc.toString((quant.getValue() / factor), 'f', Base::UnitsApi::getDecimals());
|
||||
return QString::fromUtf8("%1 %2").arg(Ln).arg(unitString);
|
||||
return toLocale(quant, factor, unitString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user