Base: QuantityFormat: avoid storing formatting defaults
User defined precision and fractional inch are stored on QuantityFormat construction making changes persistent to object life time. Change that so until not explicitely overriden, user defined values are always returned. Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
This commit is contained in:
@@ -98,7 +98,8 @@ UnitsSchema::toLocale(const Quantity& quant, const double factor, const std::str
|
||||
}
|
||||
|
||||
auto valueString =
|
||||
Lc.toString(quant.getValue() / factor, format.toFormat(), format.precision).toStdString();
|
||||
Lc.toString(quant.getValue() / factor, format.toFormat(), format.getPrecision())
|
||||
.toStdString();
|
||||
|
||||
auto notUnit = [](auto s) {
|
||||
return s.empty() || s == "°" || s == "″" || s == "′" || s == "\"" || s == "'";
|
||||
|
||||
Reference in New Issue
Block a user