summaryrefslogtreecommitdiff
path: root/bin/hafas
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-11-18 19:22:47 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-11-18 19:22:47 +0100
commitcfb45724bbc0cfcd2847dc0847d434bdcef0f2e2 (patch)
tree13e34febb6c1e02cd43f52f4287a3d1d115d51ec /bin/hafas
parent1b00e8c899793f986639aa56289988223090c697 (diff)
hafas: distinguish between 1 minute and ≠1 minutes in output
Diffstat (limited to 'bin/hafas')
-rwxr-xr-xbin/hafas7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/hafas b/bin/hafas
index 7d51f7d..deccb63 100755
--- a/bin/hafas
+++ b/bin/hafas
@@ -374,8 +374,11 @@ for my $res ( $hafas->connections ) {
}
elsif ( $sec->type eq 'WALK' ) {
printf(
- "${output_bold}Walk %dm${output_reset} (approx. %d minutes)",
- $sec->distance, $sec->duration->in_units('minutes') );
+ "${output_bold}Walk %dm${output_reset} (approx. %d minute%s)",
+ $sec->distance,
+ $sec->duration->in_units('minutes'),
+ $sec->duration->in_units('minutes') == 1 ? q{} : 's'
+ );
}
else {
printf("\n???\n");