Skip to content

Commit

Permalink
Fix for saltstack#45620: "Salt CLI is rounding floats to 2 decimal pl…
Browse files Browse the repository at this point in the history
…aces" (actually: Salt CLI is using only 12 digits for precision)

use repr() to get the full precision also for older python versions
as until about python32 it was limited to 12 digits only by default
  • Loading branch information
erwindon committed Aug 19, 2018
1 parent f8c55b8 commit 2149e22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion salt/output/nested.py
Expand Up @@ -81,12 +81,14 @@ def display(self, ret, indent, prefix, out):
)
# Number includes all python numbers types
# (float, int, long, complex, ...)
# use repr() to get the full precision also for older python versions
# as until about python32 it was limited to 12 digits only by default
elif isinstance(ret, Number):
out.append(
self.ustring(
indent,
self.LIGHT_YELLOW,
ret,
repr(ret),
prefix=prefix
)
)
Expand Down

0 comments on commit 2149e22

Please sign in to comment.