Base: add convenience functions to create a QString from quantity or double

This commit is contained in:
wmayer
2021-04-20 14:07:20 +02:00
parent cf23e622ed
commit e4f98b4512
4 changed files with 27 additions and 0 deletions

View File

@@ -63,6 +63,14 @@ QuantityFormat::QuantityFormat()
{
}
QuantityFormat::QuantityFormat(QuantityFormat::NumberFormat format, int decimals)
: option(OmitGroupSeparator | RejectGroupSeparator)
, format(format)
, precision(decimals < 0 ? UnitsApi::getDecimals() : decimals)
, denominator(defaultDenominator)
{
}
// ----------------------------------------------------------------------------
Quantity::Quantity()