From 5550bdf055b8ec9619f5ebfe6c47e13fb4605590 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 13 Oct 2023 19:53:47 +0100 Subject: Show hours live in more human-readable units. * rent.scm (list-house): Show hours live in hours or days as appropriate. --- rent.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rent.scm b/rent.scm index 7ae101d..9a0857a 100644 --- a/rent.scm +++ b/rent.scm @@ -397,14 +397,19 @@ and not distance as the crow flies." (define (list-house house) "Display details of @var{house} on the current output port." (format (current-output-port) - "~a (posted ~a hours ago) + "~a (posted ~a ago) ~a/~a £~a pcm Available from ~a Cycling distance: ~,1f km " (house-title house) - (house-hours-live house) + (if (< (house-hours-live house) 24) + (format #f "~a hours" + (house-hours-live house)) + (format #f "~a days" + (round-quotient (house-hours-live house) + 24))) %openrent-base-url (house-property-id house) (house-rent house) -- cgit v1.2.3