https://github.com/FreeCAD/FreeCAD/blob ... .FCMat#L17 The minus is no minus ...
Code: Select all
# with minus
ThermalConductivity = 25.83e-3 W/m/K
#
#
# from Nitrogen card
ThermalConductivity = 25.83e−3 W/m/K[
Code: Select all
from FreeCAD import Units
Units.Quantity('25.83e−3 W/m/K')
Code: Select all
>>>
>>> Units.Quantity('25.83e−3 W/m/K')
Traceback (most recent call last):
File "<input>", line 1, in <module>
ValueError: syntax error
>>>
Code: Select all
from FreeCAD import Units
Units.Quantity('123abc456 m')
Code: Select all
>>>
>>> from FreeCAD import Units
>>> Units.Quantity('123abc456 m')
Traceback (most recent call last):
File "<input>", line 1, in <module>
ValueError: syntax error
>>>
What we could do is write some method to check the values as I started here: https://github.com/FreeCAD/FreeCAD/blob ... ls.py#L452