Handbook
Glossary
duration>human-readable ( duration -- string )
Vocabulary
calendar.format
Inputs
duration
an
object
Outputs
string
an
object
Definition
USING:
calendar
io
io.streams.string
kernel
math
math.parser
;
IN:
calendar.format
:
duration>human-readable
( duration -- string )
[
[
duration>years
>integer
[
[
number>string
write
]
[
1
>
" years, "
" year, "
?
write
]
bi
]
unless-zero
]
[
duration>days
>integer
365
mod
[
[
number>string
write
]
[
1
>
" days, "
" day, "
?
write
]
bi
]
unless-zero
]
[
duration>hms
write
]
tri
]
with-string-writer
;