Browse Source

Fix yaml matrix formatting bug

Vadim Markovtsev 7 years ago
parent
commit
d3c991815f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      stdout/utils.go

+ 4 - 1
stdout/utils.go

@@ -31,7 +31,10 @@ func PrintMatrix(matrix [][]int64, name string, fixNegative bool) {
 	}
 	}
 	width := len(strconv.FormatInt(maxnum, 10))
 	width := len(strconv.FormatInt(maxnum, 10))
 	if !fixNegative && minnum < 0 {
 	if !fixNegative && minnum < 0 {
-		width = len(strconv.FormatInt(minnum, 10))
+		negativeWidth := len(strconv.FormatInt(minnum, 10))
+		if negativeWidth > width {
+			width = negativeWidth
+		}
 	}
 	}
 	last := len(matrix[len(matrix)-1])
 	last := len(matrix[len(matrix)-1])
 	indent := 2
 	indent := 2