Skip to content

Commit

Permalink
add extra space between col1 and col2 to be sure to always separate t…
Browse files Browse the repository at this point in the history
…hese to column even if widht is set to low
  • Loading branch information
Juke34 committed Sep 12, 2024
1 parent a6dc183 commit ebd740d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/AGAT/OmniscientStat.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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{

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ebd740d

Please sign in to comment.