From ebd740db0e588c63d9b538db5050c5eb61404e6f Mon Sep 17 00:00:00 2001 From: Jacques Dainat Date: Thu, 12 Sep 2024 10:14:14 +0200 Subject: [PATCH] add extra space between col1 and col2 to be sure to always separate these to column even if widht is set to low --- lib/AGAT/OmniscientStat.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/AGAT/OmniscientStat.pm b/lib/AGAT/OmniscientStat.pm index 3171a09..3907fb7 100644 --- a/lib/AGAT/OmniscientStat.pm +++ b/lib/AGAT/OmniscientStat.pm @@ -46,7 +46,7 @@ This is the code to perform statisctis of data store in Omniscient. =cut # define first column width -my $width = '%-45s'; +my $width = '%-60s'; sub print_omniscient_statistics{ @@ -261,16 +261,16 @@ sub recreate_sentence{ # ask for rounded value if (defined($infos->[2])){ - $sentence = sprintf("$width%.1f%s", "$infos->[0]", "$infos->[1]", "\n"); + $sentence = sprintf("$width%.1f%s", $infos->[0]." ", $infos->[1], "\n"); } # na value elsif($infos->[1] eq "na"){ - $sentence = sprintf( "$width%s%s", "$infos->[0]", "$infos->[1]", "\n"); + $sentence = sprintf( "$width%s%s", $infos->[0]." ", $infos->[1], "\n"); }else{ my $float = $infos->[1]; # With this calculation -1.4 is rounded to -1, and -1.6 to -2, and zero won't explode. my $rounded = int($float + $float/abs($float*2 || 1)); - $sentence = sprintf( "$width%d%s", "$infos->[0]", $rounded, "\n"); + $sentence = sprintf( "$width%d%s", $infos->[0]." ", $rounded, "\n"); } return $sentence;