Antonio: Num2Word.prg
Antonio: Num2Word.prg
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"
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"
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Antonio: Num2Word.prg
Thank you very much.
We implemented the changes.
We implemented the changes.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Antonio: Num2Word.prg
I saw there is not italian language can have the source on english
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Antonio: Num2Word.prg
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"
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"
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Antonio: Num2Word.prg
We had Italian too:
This was the original translation:
Now I changed as advised by you.
This was the original translation:
Code: Select all
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"
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Antonio: Num2Word.prg
We request other users of Spanish and Portuguese also to suggest correct translations.
Please see \fwh\source\function\num2words.prg
Please see \fwh\source\function\num2words.prg
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Antonio: Num2Word.prg
the italian language is wrong
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"
Code: Select all
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"
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"
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Antonio: Num2Word.prg
Mr Silvio
I now adopted what you suggested.
I now adopted what you suggested.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Antonio: Num2Word.prg
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"
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"
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Antonio: Num2Word.prg
nageswaragunupudi wrote:Mr Silvio
I now adopted what you suggested.
thanks to try the function can you write wich are c1 and c2 parameters ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Antonio: Num2Word.prg
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:
Result:
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
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.
Code: Select all
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
G. N. Rao.
Hyderabad, India
Re: Antonio: Num2Word.prg
Mr Rao,
This result in portuguese is wrong:
Quatro mil quinhentos e sessenta sete reais e vinte três centavos
This result in portuguese is wrong:
For this value(4567,23), the right result should be:Reals quatro mil cinco cento sessenta sete e cents vinte três
Quatro mil quinhentos e sessenta sete reais e vinte três centavos
Re: Antonio: Num2Word.prg
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.
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
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Antonio: Num2Word.prg
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
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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC