Skip to content

Commit b33166a

Browse files
authored
Fix table column alignment for ratio values (#497)
The ljust padding in format_ratio added trailing spaces to reserve room for significance symbols, but these spaces were then stripped by rstrip in the table formatter's format_row, causing the last column to lose its right-alignment. This was exposed by #492 which made pval nil when --pvalue is not passed, meaning the significance symbol is always empty in the common case, yet the ljust padding was still applied and then stripped. Remove the ljust padding entirely and let the table formatter handle column alignment, restoring the original format_ratio logic.
1 parent 13eee7a commit b33166a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/results_table_builder.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ def gc_ratio(base, other)
214214
def format_ratio(ratio, pval)
215215
sym = significance_symbol(pval)
216216
formatted = "%.3f" % ratio
217-
suffix = sym.empty? ? "" : " (#{sym})"
218-
(formatted + suffix).ljust(formatted.length + 6)
217+
sym.empty? ? formatted : "#{formatted} (#{sym})"
219218
end
220219

221220
def format_p_value(pval)

0 commit comments

Comments
 (0)