Looking for a function that will convert a number to words. Example: $ 1,550.50 need to convert to ********One Thousand Five Hundred Fifty Dollars and 50/100
------
DISCLOSURE
We are the Australasian Distributor for the Hentzenwerke Series of Books. (By the same token, I really do think they're the best printed VFP resource out there -- that's why we sell them)
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
Nice to see you're making your checks as safe as possible.
Better than certain unnamed government(s) who after all these years still don't print the amount in words on their checks! (Hey, obviously just a rhetorical question, no reply expected.) A number-to-words program was something I wrote back in the 1980s as a novice programmer. In the past forgers have had a field day altering checks where just a swapped digit makes a big difference. (Some have said it's not their hard-earned money so they don't care much, what's a fraction of a percent anyway?)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.