From 2149e228ac2e5bfee192f5b9b3e5d86f8c273e17 Mon Sep 17 00:00:00 2001 From: Erwin Dondorp Date: Sat, 18 Aug 2018 13:22:05 +0200 Subject: [PATCH] Fix for #45620: "Salt CLI is rounding floats to 2 decimal places" (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 --- salt/output/nested.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/salt/output/nested.py b/salt/output/nested.py index 7d21dba49f9b..c4c2e2ed7d7a 100644 --- a/salt/output/nested.py +++ b/salt/output/nested.py @@ -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 ) )