Materials: Change display of Quantity values

The default display type of quantity objects is fixed point resulting
in insufficient accuracy when changing unit systems, or when the values
are small. This fix changes the default format from 'Fixed' to the more
apt 'Default' format. This allows the displayed values to scale as
appropriate.

Fixes #18149
This commit is contained in:
David Carter
2024-12-11 09:26:06 -05:00
committed by Chris Hennes
parent 939506007d
commit 7e1b1abddd
12 changed files with 179 additions and 86 deletions

View File

@@ -48,7 +48,9 @@ TYPESYSTEM_SOURCE(App::PropertyQuantity, App::PropertyFloat)
Base::Quantity PropertyQuantity::getQuantityValue() const
{
return Quantity(_dValue, _Unit);
Quantity quantity(_dValue, _Unit);
quantity.setFormat(_Format);
return quantity;
}
const char* PropertyQuantity::getEditorName() const
@@ -129,7 +131,9 @@ void PropertyQuantity::setPathValue(const ObjectIdentifier& /*path*/, const boos
const boost::any PropertyQuantity::getPathValue(const ObjectIdentifier& /*path*/) const
{
return Quantity(_dValue, _Unit);
Quantity quantity(_dValue, _Unit);
quantity.setFormat(_Format);
return quantity;
}
//**************************************************************************