Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

alias r return return

alias g $r $gettok($1,$2,46)
alias w $r $right(%z,$1)
alias numconv {
tokenize 32 $remove($1,$chr(44))
var %b,%x,%n $g(0 $+ $1,1),%i $len(%n),%1 One.Two.Three.Four.Five.Six.Seven.Ei
ght.Nine.Ten.Eleven.Twelve.Thir.Four.Fif.Six.Seven.Eigh.Nine,%3 0.Twen.Thir.For.
$+ $g(%1,15-),%4 Thousand.M.B.Tr.Quadr.Quint.Sext.Sept.Oct.Non.Dec.Un.Duo.Tre.Q
uattuor.Quin.Sex.Septen.Octo.Novem.Vigint
if $iif(%n,%n,$1) !isnum || $g(0 $+ $1,3) || (%i > 67 && %n > 0) {
$r $iif($1,Invalid)
}
while %i > 1 {
%z = $right($left(%n,%i),3)
%a = $w(2)
%x = $iif(%z > 99,$g(%1,$left(%z,1)) Hundred) $iif(%a > 20,$+($g(%3,$left(%a
,1)),ty,$iif($w(1),- $+ $g(%1,$w(1)))),$iif(%a > 0,$g(%1,%a) $+ $iif(%a > 12,tee
n))) $iif(%z > 0 && %b,$+($g(%4,%b),$iif(%b isnum 12-20,dec),$iif(%b > 1,illion)
)) %x
dec %i 3
inc %b
}
$r $iif(!%n,Zero,%x)
}

You might also like