Handbook
Glossary
parse-decimal ( str -- ratio )
Vocabulary
money
Inputs
str
an
object
Outputs
ratio
an
object
Definition
USING:
kernel
math
math.functions
math.parser
sequences
;
IN:
money
:
parse-decimal
( str -- ratio )
split-decimal
[
[
"0"
]
when-empty
]
bi@
[
[
[
string>number
]
[
not-an-integer
]
?unless
]
bi@
]
keep
length
10^
/
+
swap
[
neg
]
when
;