Round component parameter values to 3 digits
This commit is contained in:
parent
f6a9ce622c
commit
f092977b2a
@ -231,10 +231,10 @@ class ComponentParameter(models.Model):
|
|||||||
if my_type == 'E' or my_type == 'I':
|
if my_type == 'E' or my_type == 'I':
|
||||||
# Engineering float number
|
# Engineering float number
|
||||||
(num, prefix) = NumConv.number_to_engineering(self.value, it_unit=(True if my_type=='I' else False))
|
(num, prefix) = NumConv.number_to_engineering(self.value, it_unit=(True if my_type=='I' else False))
|
||||||
return f'{num} {prefix}{self.parameter_type.unit}'
|
return f'{num:.3f} {prefix}{self.parameter_type.unit}'
|
||||||
elif my_type == 'N':
|
elif my_type == 'N':
|
||||||
# Standard float number
|
# Standard float number
|
||||||
return f'{self.value} {self.parameter_type.unit}'
|
return f'{self.value:.3f} {self.parameter_type.unit}'
|
||||||
elif my_type == 'F':
|
elif my_type == 'F':
|
||||||
return self.text_value
|
return self.text_value
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user