We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 483b5bd commit 92fba25Copy full SHA for 92fba25
scan/commands/set.py
@@ -119,6 +119,13 @@ def __repr__(self):
119
result = "Set('%s'" % self.__device
120
if isinstance(self.__value, str):
121
result += ", '%s'" % self.__value
122
+ elif isinstance(self.__value, float):
123
+ # Reproduce the default floating point number format provided by Python 2 (and 3.1)
124
+ # (See: https://stackoverflow.com/questions/25898733/why-does-strfloat-return-more-digits-in-python-3-than-python-2/25899600#25899600)
125
+ if self.__value.is_integer():
126
+ result += ", %.12g.0" % self.__value
127
+ else:
128
+ result += ", %.12g" % self.__value
129
else:
130
result += ", %s" % str(self.__value)
131
if self.__completion:
0 commit comments