Handbook
Glossary
parse-1hr-temp ( str -- str' )
Vocabulary
metar
.
private
Inputs
str
an
object
Outputs
str'
an
object
Definition
USING:
formatting
kernel
math
sequences
splitting
;
IN:
metar.private
:
parse-1hr-temp
( str -- str' )
"T"
?head
drop
dup
length
4
>
[
double-value
[
dup
C>F
"%.1f °C (%.1f °F)"
sprintf
]
bi@
"hourly temperature %s and dew point %s"
sprintf
]
[
single-value
dup
C>F
"hourly temperature %.1f °C (%.1f °F)"
sprintf
]
if
;