From 416c7225113ee22297a3332282c5c9010452fbf5 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Mon, 30 Jan 2023 05:04:38 +0100 Subject: [PATCH] Pad differently Experimental code (never committed) had ANSI escape sequences there, and required manual padding. Those were gone, but I forgot to change the manual padding into normal sprintf padding. This also makes it explicit that the left alignment is actually intended here. (Actually looks better here.) --- lib/RevBank/Cart/Entry.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/RevBank/Cart/Entry.pm b/lib/RevBank/Cart/Entry.pm index 57068ba..32d5cf3 100644 --- a/lib/RevBank/Cart/Entry.pm +++ b/lib/RevBank/Cart/Entry.pm @@ -106,9 +106,9 @@ sub as_printable($self) { # numbers. Here, the implied sign is "-", and a "+" is only added for # positive numbers. my $q = $self->{quantity}; - push @s, sprintf "%s%s%s" . "%s%6s%s" . " " . "%s%s%s", + push @s, sprintf "%s%-4s%s" . "%s%6s%s" . " " . "%s%s%s", ($self->{highlight} || $self->{highlight_quantity} ? $HI : $LO), - ($q > 1 || $self->{highlight_quantity} ? "${q}x" . " " x (3 - length $q) : " " x 4), + ($q > 1 || $self->{highlight_quantity} ? "${q}x" : ""), ($self->{highlight} ? "" : $END), ($self->{highlight} || $self->{highlight_amount} ? $HI : $LO),