$string="1999999999999999" ?
$string " as text is about the same as:" num2text($string)
$string="2999" ?
$string " as text is about the same as:" num2text($string)
get $
function num2text($n)
dim $m,$d,$t,$g,$o,$l
$n=""+$n ;making sure it's string
$m=split(" thousand million billion trillion quadrillion quintillion sextillion septillion octillion nonillion decillion undecillion duodecillion tredecillion")
$t='',one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,eighteen,nineteen
$d='','',twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety
do
$l=len($n)
if $l mod 3
$g=left($n,$l mod 3)
$n=right($n,-($l mod 3))
else
$g=left($n,3)
$n=right($n,-3)
endif
if len($g)=3
$o=" "+$t[left($g,1)]+" hundred"
$g=right($g,-1)
endif
if 20>$g
$o=$o+$t[0+$g]
if 0=$n
$o=" zero"
endif
else
$o=$o+" "+$d[1*$g/10]+" "+$t[right($g,1)]
endif
$num2text=trim($num2text+$o+" "+$m[($l-1)/3])
$o=''
until len($n)<3
endfunction