mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +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 = ""
|
||||
|
||||
def set_value(self, attribute_name, value):
|
||||
if isinstance(value, float):
|
||||
value = round(value, 3)
|
||||
value = str(value)
|
||||
setattr(self, f"_{attribute_name}", value)
|
||||
|
||||
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):
|
||||
value = getattr(self, f"_{attribute_name}")
|
||||
|
||||
Reference in New Issue
Block a user