Antonio: Num2Word.prg

Antonio: Num2Word.prg

Postby byte-one » Mon Jun 05, 2017 3:20 pm

Antonio, for german you should make this definition:

case nLang == 5 // German
aNums := { "ein", "zwei", "drei", "vier", "fünf", "sechs", "sieben", "acht", "neun", "zehn", ;
"elf", "zwölf", "dreizehn", "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn ", "zwanzig" }
aTens := { "zehn", "zwanzig", "dreißig", "vierzig", "fünfzig", "sechzig", "siebzig", "achtzig", "neunzig" }
aUnits := { "hundert", "tausend", "millionen", "milliarden" }
cAnd := " und"
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Antonio: Num2Word.prg

Postby nageswaragunupudi » Tue Jun 06, 2017 12:05 am

Thank you very much.
We implemented the changes.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10634
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Num2Word.prg

Postby Silvio.Falconi » Tue Jun 06, 2017 10:00 am

I saw there is not italian language can have the source on english
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Antonio: Num2Word.prg

Postby Silvio.Falconi » Tue Jun 06, 2017 10:05 am

case nLang == 6 // Italian
aNums := { "uno", "due", "tre", "quattro", "cinque", "sei", "sette", "otto", "nove", "dieci", ;
"undici", "dodici", "tredici", "quattordici", "quindici", "sedici", "diciasette", "diciotto", "diciannove ", "venti" }
aTens := { "dieci", "venti", "trenta", "quaranta", "cinquanta", "sessanta", "settanta", "ottanta", "novanta" }
aUnits := { "cento", "mille", "millione", "milliardo" }
cAnd := " e"
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Antonio: Num2Word.prg

Postby nageswaragunupudi » Tue Jun 06, 2017 1:35 pm

We had Italian too:
This was the original translation:
Code: Select all  Expand view
     aNums    := { "One", "due", "tre", "quattro", "cinque", "sei", "sette", "otto", "nove", "th", ;
                    "Undici", "dodici", "tredici", "quattordici", "quindici", "sedici", "diciassette", "diciotto", "diciannove", "venti" }
      aTens    := { "Th", "venti", "trenta", "quaranta", "cinquanta", "sessanta", "settanta", "ottanta", "novanta" }
      aUnits   := { "Cento", "mille", "milioni", "miliardi" }
      cAnd     := " e"
 

Now I changed as advised by you.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10634
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Num2Word.prg

Postby nageswaragunupudi » Tue Jun 06, 2017 1:36 pm

We request other users of Spanish and Portuguese also to suggest correct translations.
Please see \fwh\source\function\num2words.prg
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10634
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Num2Word.prg

Postby Silvio.Falconi » Tue Jun 06, 2017 1:52 pm

the italian language is wrong
Code: Select all  Expand view

 aNums    := { "One", "due", "tre", "quattro", "cinque", "sei", "sette", "otto", "nove", "th", ;
                    "Undici", "dodici", "tredici", "quattordici", "quindici", "sedici", "diciassette", "diciotto", "diciannove", "venti" }
      aTens    := { "Th", "venti", "trenta", "quaranta", "cinquanta", "sessanta", "settanta", "ottanta", "novanta" }
      aUnits   := { "Cento", "mille", "milioni", "miliardi" }
      cAnd     := " e"

 


this is the right

aNums := { "uno", "due", "tre", "quattro", "cinque", "sei", "sette", "otto", "nove", "dieci", ;
"undici", "dodici", "tredici", "quattordici", "quindici", "sedici", "diciasette", "diciotto", "diciannove ", "venti" }
aTens := { "dieci", "venti", "trenta", "quaranta", "cinquanta", "sessanta", "settanta", "ottanta", "novanta" }
aUnits := { "cento", "mille", "millione", "milliardo" }
cAnd := " e"
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Antonio: Num2Word.prg

Postby nageswaragunupudi » Tue Jun 06, 2017 2:10 pm

Mr Silvio

I now adopted what you suggested.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10634
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Num2Word.prg

Postby vilian » Tue Jun 06, 2017 2:12 pm

In portuguese:

aNums := { "um", "dois", "três", "quatro", "cinco", "seis", "sete", "oito", "nove", "dez", ;
"onze", "doze", "treze", "quatorze", "quinze", "dezesseis", "dezessete", "dezoito", "dezenove", "vinte" }
aTens := { "dez", "vinte", "trinta", "quarenta", "cinquenta", "sessenta", "setenta", "oitenta", "noventa" }
aUnits := { "cento", "mil", "milhão", "bilhão" }
cAnd := " e"
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 976
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Antonio: Num2Word.prg

Postby nageswaragunupudi » Tue Jun 06, 2017 2:20 pm

Mr Vilian

Thank you. Adopted
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10634
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Num2Word.prg

Postby Silvio.Falconi » Tue Jun 06, 2017 2:24 pm

nageswaragunupudi wrote:Mr Silvio

I now adopted what you suggested.



thanks to try the function can you write wich are c1 and c2 parameters ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Antonio: Num2Word.prg

Postby nageswaragunupudi » Tue Jun 06, 2017 3:25 pm

The function uses the currency name corresponding to the region set in
FWNumFormat( cRegion, [lThousandSeparator] )

cRegion can be 'A' for America (general format), 'B', for Britan, 'E' for Europe and 'I' for India. This setting decides the default numeric format:
'A' and 'B' : 999,999,999.99
'E' : 999.999.999,99
'I' : 99,99,99,999.99

function NUMPICT( 9, 2 ) --> picture depending on the country code.

It is desirable to depend on FWNumFormat() and NumPict() rather than hard-coding the picture clauses. This enables to change the numeric format globally and on the fly for applications that need to run globally.

The function selects currency name as "Dollar", "Pound", "Euro", "Rupee" on the basis of the region 'A', 'B', 'E' or 'I'.

When a different currency name is required, parameters c1 and c2 can be used for currency name and cents name.

Example:
Code: Select all  Expand view

   FWNumFormat( "E", .t. )  // European format
   FW_N2WSETUP( 4 ) // Portuguese
   ? FW_NUMTOWORDS( 4567.23 )
   ? FW_NUMTOWORDS( 4567.23, "Real", "cents" ) // The names will be used for all subsequent calls.
 


Result:
Code: Select all  Expand view

Euros quatro mil cinco cento sessenta sete e  cents vinte três
Reals quatro mil cinco cento sessenta sete e cents vinte três
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10634
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Antonio: Num2Word.prg

Postby vilian » Tue Jun 06, 2017 3:59 pm

Mr Rao,

This result in portuguese is wrong:
Reals quatro mil cinco cento sessenta sete e cents vinte três


For this value(4567,23), the right result should be:

Quatro mil quinhentos e sessenta sete reais e vinte três centavos
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 976
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Antonio: Num2Word.prg

Postby miragerr » Tue Jun 06, 2017 5:14 pm

Ola... Boa tarde

Vilian, creio que esteja faltando uma variável do tipo

------------------100-------200------------300----------400------------500-------------600-------------700------------800---------900
aCentenas := { "Cem", "Duzentos","Trezentos","Quatrocentos","Quinhentos","Seiscentos","Setecentos","Oitocentos","Novecentos"}

Creio que seja isto.

Espero ter ajudado.
Jackson Douglas C. Brito
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
User avatar
miragerr
 
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

Re: Antonio: Num2Word.prg

Postby Silvio.Falconi » Tue Jun 06, 2017 5:27 pm

Nages,
I Try with
FWNumFormat( "E", .t. ) // European format
FW_N2WSETUP( 6 ) // Italian
? FW_NUMTOWORDS( 4567.23 )
? FW_NUMTOWORDS( 4567.23, "Euro", "centesimi" )

give me :
Euros quattro mille cinque Cento sessanta sette e cents vent tre

but this is wrong because

Quattromilacinquecentosessantasette/23

If the banck check is 500 euros, it is necessary to write: cinquecento/00.

If it is 500.50 euros, it is necessary to write: cinquecento/50

In case of 4567.23 In Italy I write

Euro QuattroMilaCinqueCentoSessantaSette/23

then you can ask also to Enrico Maria Giordano or another Italian friend

for try a test you can go to internet at https://www.blia.it/cifralettere/ and insert the number you want
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests