mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
Small fix on how the input UI rounds numbers
This commit is contained in:
committed by
Bruno Perdigão
parent
aaa3d5c443
commit
edf0804b0e
@@ -45,13 +45,16 @@ class PolylineUI:
|
|||||||
self._AREA = ""
|
self._AREA = ""
|
||||||
|
|
||||||
def set_value(self, attribute_name, value):
|
def set_value(self, attribute_name, value):
|
||||||
if isinstance(value, float):
|
|
||||||
value = round(value, 3)
|
|
||||||
value = str(value)
|
value = str(value)
|
||||||
setattr(self, f"_{attribute_name}", value)
|
setattr(self, f"_{attribute_name}", value)
|
||||||
|
|
||||||
def get_text_value(self, attribute_name):
|
def get_text_value(self, attribute_name):
|
||||||
return getattr(self, f"_{attribute_name}")
|
value = getattr(self, f"_{attribute_name}")
|
||||||
|
try:
|
||||||
|
value = f"{float(value):.3g}"
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return value
|
||||||
|
|
||||||
def get_number_value(self, attribute_name):
|
def get_number_value(self, attribute_name):
|
||||||
value = getattr(self, f"_{attribute_name}")
|
value = getattr(self, f"_{attribute_name}")
|
||||||
|
|||||||
Reference in New Issue
Block a user