Thanks Richard! You ProFoxer's are the greatest!

-----Original Message-----
From: Richard Kaye 
Sent: Wednesday, March 07, 2007 12:16 PM
To: Fleck, Timothy
Subject: RE: Looking for a French Translator UDF for Check Printing

You may want to beautify this... It's got some specific things for our
environment but should be enough to get you there.

*** saymoney.prg***

LPARAMETER m.amount
LOCAL m.sayamount

IF TYPE('numbertext')='U'
* this gets released by prntchk form
PUBLIC ARRAY numbertext[27]
numbertext[1]='un'
numbertext[2]='deux'
numbertext[3]='trois'
numbertext[4]='quatre'
numbertext[5]='cinq'
numbertext[6]='six'
numbertext[7]='sept'
numbertext[8]='huit'
numbertext[9]='neuf'
numbertext[10]='dix'
numbertext[11]='onze'
numbertext[12]='douze'
numbertext[13]='treize'
numbertext[14]='quatorze'
numbertext[15]='quinze'
numbertext[16]='seize'
numbertext[17]='dix-sept'
numbertext[18]='dix-huit'
numbertext[19]='dix-neuf'
numbertext[20]='vingt'
numbertext[21]='trente'
numbertext[22]='quarante'
numbertext[23]='cinquante'
numbertext[24]='soixante'
numbertext[25]='soixante-dix'
numbertext[26]='quatre-vingts'
numbertext[27]='quatre-vingt-dix'
ENDIF

IF m.amount<1000000000 AND m.amount>0

m.dollars=STR(INT(m.amount),9)
m.cents=RIGHT(STR(m.amount,12,2),2)
m.sayamount=''

millions=LEFT(m.dollars,3)
IF VAL(millions)>0
m.hund=VAL(LEFT(millions,1))
m.tens=VAL(SUBSTR(millions,2,1))
m.tens=IIF(m.tens<2,0,m.tens)
m.ones=VAL(RIGHT(millions,IIF(m.tens<2,2,1)))
m.sayamount=m.sayamount+IIF(m.hund>0,TRIM(numbertext[m.hund])+"
cent"+IIF(m.tens+m.ones=0,"s "," "),'')
m.sayamount=m.sayamount+IIF(m.tens>0,TRIM(numbertext[m.tens-2+20])+"
",'') m.sayamount=m.sayamount+IIF(m.ones>0,TRIM(numbertext[m.ones])+"
",'') 
m.sayamount=m.sayamount+"millions "
ENDIF

thousands=SUBSTR(m.dollars,4,3)
IF VAL(thousands)>0
m.hund=VAL(LEFT(thousands,1))
m.tens=VAL(SUBSTR(thousands,2,1))
m.tens=IIF(m.tens<2,0,m.tens)
m.ones=VAL(RIGHT(thousands,IIF(m.tens<2,2,1)))
m.sayamount=m.sayamount+IIF(m.hund>0,TRIM(numbertext[m.hund])+"
cent"+IIF(m.tens+m.ones=0,"s "," "),'')
m.sayamount=m.sayamount+IIF(m.tens>0,TRIM(numbertext[m.tens-2+20])+"
",'') m.sayamount=m.sayamount+IIF(m.ones>0,TRIM(numbertext[m.ones])+"
",'') 
m.sayamount=m.sayamount+"mille "
ENDIF

m.hundreds=RIGHT(m.dollars,3)
m.hund=VAL(LEFT(m.hundreds,1))
m.tens=VAL(SUBSTR(m.hundreds,2,1))
m.tens=IIF(m.tens<2,0,m.tens)
m.ones=VAL(RIGHT(m.hundreds,IIF(m.tens<2,2,1)))
m.sayamount=m.sayamount+IIF(m.hund>0,TRIM(numbertext[m.hund])+"
cent"+IIF(m.tens+m.ones=0,"s "," "),'')
m.sayamount=m.sayamount+IIF(m.tens>0,TRIM(numbertext[m.tens-2+20])+"
",'') m.sayamount=m.sayamount+IIF(m.ones>0,TRIM(numbertext[m.ones])+"
",'')
m.sayamount=m.sayamount+IIF(VAL(m.cents)>0,"et "+m.cents+"/100
",'')+"euros"

ELSE
IF m.amount=0
m.sayamount="zero euros"
ELSE
m.sayamount=IIF(m.amount>0,'INVALIDE','INVALIDE')
ENDIF
ENDIF

IF m.sayamount='un cent' OR m.sayamount='un mille'
m.sayamount=ALLT(SUBSTR(m.sayamount,4,500))
ENDIF

RELEASE numbertext

RETURN m.sayamount
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Fleck, Timothy
Sent: Wednesday, March 07, 2007 11:23 AM
To: [EMAIL PROTECTED]
Subject: Looking for a French Translator UDF for Check Printing

 We need to print our checks in Toronto in French! I was wondering if
anyone has gone through the exercise of sending a dollar amount figure
and having is print like "Twenty Dollars and thirty-five cents" in
French?

Thanks in advance,

Tim


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to