mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
@@ -203,8 +203,8 @@ class Unit(bonsai.core.tool.Unit):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def format_value(cls, value: float) -> str:
|
def format_value(cls, value: float) -> str:
|
||||||
precision = tool.Ifc.get().by_type("IfcGeometricRepresentationContext")[0].Precision
|
context = next(iter(tool.Ifc.get().by_type("IfcGeometricRepresentationContext")), None)
|
||||||
if precision:
|
if context and (precision := context.Precision):
|
||||||
decimal_places = math.ceil(math.log10(1 / precision))
|
decimal_places = math.ceil(math.log10(1 / precision))
|
||||||
else:
|
else:
|
||||||
precision = 1e-5
|
precision = 1e-5
|
||||||
|
|||||||
Reference in New Issue
Block a user