aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-10-13 19:53:47 +0100
committerArun Isaac2023-10-13 19:55:41 +0100
commit5550bdf055b8ec9619f5ebfe6c47e13fb4605590 (patch)
treea774478adadc82df5396bcca4659185f5815fcb1
parent35e35f233b5dcf7669361df5ebb8e33f799ae52d (diff)
downloadrent-in-london-5550bdf055b8ec9619f5ebfe6c47e13fb4605590.tar.gz
rent-in-london-5550bdf055b8ec9619f5ebfe6c47e13fb4605590.tar.lz
rent-in-london-5550bdf055b8ec9619f5ebfe6c47e13fb4605590.zip
Show hours live in more human-readable units.
* rent.scm (list-house): Show hours live in hours or days as appropriate.
-rw-r--r--rent.scm9
1 files 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)