Hi
myAmount = nnnnnnnnn.nnnn
AmountInWord = NumToWord(myAmount)
Copy the following to the end of your main.prg.
**********************************************************
FUNCTION numtoword
PARAMETER amt
amt = ABS(amt)
nDecimal = SET("DECIMAL"

SET DECIMALS TO 18
m.numphrase = " "
IF INT(amt / 1000000) > 0 && Amount in millions?
m.numphrase = m.numphrase + numword(INT(amt/1000000))+ ;
" Million "
ENDIF
IF INT(amt / 1000) > 0 && Amount in thousands?
m.numphrase = m.numphrase + ;
numword(MOD(INT(amt / 1000),1000))+" Thousand "
ENDIF
m.numphrase = ;
ALLTRIM(m.numphrase + numword(MOD(INT(amt),1000)))
m.cent = MOD(amt * 100, 100) && Get decimal
IF m.cent > 0
m.numphrase = ALLTRIM(m.numphrase) + " and " + ;
ALLTRIM(STR(m.cent)) + "/100"
ENDIF
IF LEN(ALLTRIM(m.numphrase)) > 1
m.numphrase = m.numphrase + " Only."
ENDIF
SET DECIMALS TO nDecimal
RETURN m.numphrase
*********************************************************
** Called by: numtoword()
*********************************************************
FUNCTION numword
PARAMETER amt
DECLARE one[10]
DECLARE ten[10]
DECLARE teen[10]
one[1] = "One"
one[2] = "Two"
one[3] = "Three"
one[4] = "Four"
one[5] = "Five"
one[6] = "Six"
one[7] = "Seven"
one[8] = "Eight"
one[9] = "Nine"
ten[1] = "Ten"
ten[2] = "Twenty"
ten[3] = "Thirty"
ten[4] = "Fourty"
ten[5] = "Fifty"
ten[6] = "Sixty"
ten[7] = "Seventy"
ten[8] = "Eighty"
ten[9] = "Ninety"
teen[1] = "Eleven"
teen[2] = "Twelve"
teen[3] = "Thirteen"
teen[4] = "Fourteen"
teen[5] = "Fifteen"
teen[6] = "Sixteen"
teen[7] = "Seventeen"
teen[8] = "Eighteen"
teen[9] = "Ninteen"
m.hundred = INT(amt/100) && Get decimal position 1
IF m.hundred > 0
m.numphrase = one[m.hundred] + " Hundred "
ELSE
m.numphrase = " "
ENDIF
m.decpos2 = MOD(amt, 100) && Get decimal position 2
m.decpos3 = INT(m.decpos2/10) && Get decimal position 3
IF m.decpos2 >= 11 AND m.decpos2 <= 19 && Number in teens?
m.numphrase = m.numphrase + teen[INT(MOD(m.decpos2, 10))]
ELSE && Not in teens
IF m.decpos3 > 0
m.numphrase = m.numphrase + ten[INT(m.decpos2 / 10)]
ENDIF
IF MOD(m.decpos2, 10) > 0
m.numphrase = ALLTRIM(m.numphrase) + " " + ;
one[MOD(m.decpos2, 10)]
ENDIF
ENDIF
RETURN ALLTRIM(m.numphrase)
*********************************************************
* EOF: NUMWORD
*********************************************************
I have done similar routines number of times in different ways and I have copied routines as well from some BBSs. I sincerely dont remember everything in here is mine, since this is from my long time library. Credits to those who helped make the above.
ramani

(Subramanian.G),FoxAcc, ramani_g@yahoo.com