This reminder me of the olden days of the DOS world. I got these library codes that I used for my customized business applications. Here's the codes:
************************************************
*dollar.prg
*Larry - 5-Mar-1999
proc dollar &&for procedure file; remark this line for standalone file.
* spell amount in english
para m
priv n,s
if m=0
retu 'ZERO ONLY'
endif
dime den(4)
den(1)=''
den(2)=' THOUSAND'
den(3)=' MILLION'
den(4)=' BILLION'
cent=(m-int(m))*100
m=int(m)
s=''
n=0
do while m>0
n=n+1
s= hnds( mod(m,1000) ) + den

+ s
m=int(m/1000)
enddo
if cent>0
s=trim(s) +' AND CENTS'+ hnds(cent)
endif
*if ' '$s
* s=stuff(s,at(' ',s),2,' ')
* endif
retu alltrim(s) + ' ONLY'
func tens
para m
retu ' '+trim( subs('ONE TWO THREEFOUR FIVE SIX SEVENEIGHTNINE',m*5-4,5) )
func hnds
para m
priv s1
s1=''
if m>99
s1= tens(int(m/100)) + ' HUNDRED'
m = mod(m,100)
endif
if m>=20
s1= s1 +' '+ trim( subs(' TWENTY THIRTY FORTY FIFTY SIXTY SEVENTYEIGHTY NINETY',int(m/10)*7-6,7) )
m = mod(m,10)
else
if m>=10
m = m-10
s1= s1 +' '+ trim( subs('TEN ELEVEN TWELVE THIRTEEN FORTEEN FIFTEEN SIXTEEN SEVENTEENEIGHTEEN NINETEEN',m*9+1,9) )
m = 0
endif
endif
if m>0
s1= s1+tens(m)
m = 0
endif
retu trim(s1)
************************************************
In VFP:
?'AMOUNT: '+dollar(1234.50)
Result:
AMOUNT: ONE THOUSAND TWO HUNDRED THIRTY FOUR AND CENTS FIFTY ONLY.
Limits:
This code works up to Billions.
Free for use.
Larry