ehm. ok. I see bugs everywhere now.
even the formatnumber() doesn't behave correctly:
 Code:
$string="1999999999999999"
$string " as text is about the same as:" ?
"	" num2text($string)
get $

function num2text($n)
dim $m,$d,$t,$g,$o
 $n=""+formatnumber($n,,,,1)
 $m=split(" thousand million billion trillion omg well?")
 $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

 for each $g in split($n)
  if len($g)=3
   $o=$t[left($g,1)]+" hundred"
  else
   $o=''
  endif
  $g=right($g,-1)
  if 20>$g
   $o=$o+$t[0+$g]
   if 0=$n
    $o=zero
   endif
  else
   $g ?
   $o=$o+$d[1*$g/10]+" "+$t[right($g,1)]
  endif
  $num2text=trim($num2text+" "+$o+" "+$m[ubound(split($n))])
 next
endfunction
_________________________
!

download KiXnet