k0sm0s Numbertext - MRC

You might also like

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

alias numconv {

var %i = $remove($1-,$chr(44)),%j,%a,%b,%r,%t = 0
%j = $regsub(%i,(\.| ).*,,%i)
if (!%i) return $iif($len($1-),Zero)
if $len(%i) < 67 && $regex(%i,^[0-9]+$) {
while %i {
%j = $right(00 $+ %i,3)
%a = $c($left(%j,1))
%a = $iif(%a,%a Hundred)
%j = $right(%j,2)
if (%j < 20) %b = $c(%j) $+ $iif(%j > 12,teen)
else %b = $+($iif(%j < 40,$gettok(0TwenThir,$left(%j,1),1),$c(1 $+ $left(%j,
1))),ty,$iif($right(%j,1)!=0,- $+ $c($right(%j,1))))
%r = %a %b $iif(%a || %b,$+($remove($gettok(ThousandMBTrQuadrQuintSextSeptOctNon21UnD
oTreQuattuorQuinSexSeptenOctoNovemVigint,%t,1),21),$iif(%t > 10 && %t < 21,dec),$iif(%t
> 1,illion))) %r
%i = $left(%i,-3)
inc %t
}
return %r
}
return Invalid
}
alias c return $remove($gettok(OneTwoThreeFourFiveSixSevenEightNineTenElevenTwelveThirFourF
xSevenEighNine,$1,1),19)

You might also like