(storage>n) ( string multiplier base -- n )


Vocabulary
units.reduction

Definition
USING: assocs kernel locals math math.functions math.parser
sequences ;

IN: units.reduction

:: (storage>n) ( string multiplier base -- n )
string last unit-suffix-hash ?at [
:> unit string but-last string>number
[ "not a number" throw ] unless* multiplier unit *
base swap ^ *
] [ "unrecognized unit" throw ] if ;