Handbook
Glossary
string>decimal ( string -- decimal )
Vocabulary
decimals
Inputs
string
an
object
Outputs
decimal
an
object
Definition
USING:
kernel
math
math.parser
sequences
splitting
;
IN:
decimals
:
string>decimal
( string -- decimal )
"."
split1
[
[
48
=
]
trim-head
[
"0"
]
when-empty
]
[
[
48
=
]
trim-tail
[
""
]
when-empty
]
bi*
[
append
string>number
]
[
nip
length
neg
]
2bi
<decimal>
;