alias g return $iif($3,$token($1,$2,$3),$mid($1,$2,1)) alias numconv { var %r return,%1 OneTwoThreeFourFiveSixSevenEightNineTenElevenTwelveThirteenFourteenFifteenSixteenSeventeenEighteenNineteen,%2 TwentyThirtyFortyFiftySixtySeventyEightyNinety,%3 MBTrQuadrQuintSextSeptOctNonDecUndecDuodecTredecQuattuordecQuindecSexdecSeptendecOctodecNovemdecVigint,%n $remove($g($1,1,32),$chr(44)),%u,%s,%d if ($regex(%n,([^0-9\.]|^[-+,]|^\.+$|[0-9]{67}))) %r $iif($1 != $chr(44),Invalid) if ($regex(%n,(^\.|^0+$|^0+\..+$))) %r Zero %n = $g(%n,1,46) while %n { var %o $right(%n,3),%z $iif(%u,$iif(%u == 1,Thousand,$+($g(%3,$calc(%u -1),3),illion))) if ($len(%o) < 3) %o = $str(0,$calc(3-$len(%o))) $+ %o if %o = 0 goto c %s = $iif($g(%o,2) = 1,$g($g(%1,10-,3),$calc($g(%o,3)+1),3) %z %s,$iif($g(%o,3),$g(%1,$ifmatch,3) %z %s)) if $g(%o,2) isnum 2-9 { %d = $g(%2,$calc($ifmatch -1),3) if ($g(%o,3)) %s = $+(%d,-,%s) else %s = %d %s } if ($g(%o,1)) %s = $g(%1,$ifmatch,3) Hundred $iif(10 // $mid(%o,2,2),%z) %s :c inc %u %n = $iif($calc($len(%n)-3) < 0,0,$left(%n,$calc($len(%n)-3))) } %r %s }