parse-deposit-depth ( str -- str' )


Vocabulary
metar.private

Inputs
stran object


Outputs
str'an object


Definition


: parse-deposit-depth ( str -- str' )
{
{ [ dup "//" = ] [ drop "depth not reported" ] }
{ [ dup "00" = ] [ drop "depth less than 1 mm" ] }
{ [ dup "91" = ] [ drop "reserved depth code 91" ] }
{ [ dup "98" = ] [ drop "depth 40 cm or more" ] }
{
[ dup "99" = ]
[
drop
"runway non-operational; depth not reported"
]
}
[
string>number dup 92 <
[ "depth %s mm" sprintf ]
[ 90 - 5 * "depth %s cm" sprintf ] if
]
} cond ;