-
February 12th, 2021, 02:47 PM
#1
ToWords English into French --> For Checks
I am an English speaker, but some of our reports are used in French speaking countries. One of them needed to translate the written out form of a charge into French for checks and invoices. I used a learning web page for kids to get the list of French numbers in text and worked from there. It is an ugly cascading list of calls to "replace" but it works.
global numbervar Tempholder := {Sheet1_.Numbers};
global stringvar StrX := ToWords(Tempholder,2);
StrX := Replace( StrX, "million", "millions");
StrX := Replace( StrX, "one millions", "one million");
StrX := Replace( StrX, "one hundred", "cent");
StrX := Replace( StrX, "hundred", "cent");
StrX := Replace( StrX, "thousand", "mille");
StrX := Replace( StrX, "twenty-one", "vingt et un");
StrX := Replace( StrX, "twenty", "vingt");
StrX := Replace( StrX, "thirty-one", "trente et un");
StrX := Replace( StrX, "thirty", "trente");
StrX := Replace( StrX, "forty-one", "quarante et un");
StrX := Replace( StrX, "forty", "quarante");
StrX := Replace( StrX, "fifty-one", "cinquante et un");
StrX := Replace( StrX, "fifty", "cinquante");
StrX := Replace( StrX, "sixty-one", "soixante et un");
StrX := Replace( StrX, "sixty", "soixante");
StrX := Replace( StrX, "seventy-one", "soixante et onze");
StrX := Replace( StrX, "seventy-two", "soixante-douze");
StrX := Replace( StrX, "seventy-three", "soixante-treize");
StrX := Replace( StrX, "seventy-four", "soixante-quartorze");
StrX := Replace( StrX, "seventy-five", "soixante-quinze");
StrX := Replace( StrX, "seventy-six", "soixante-seize");
StrX := Replace( StrX, "seventy-seven", "soixante-dix-sept");
StrX := Replace( StrX, "seventy-eight", "soixante-dix-huit");
StrX := Replace( StrX, "seventy-nine", "soixante-dix-neuf");
StrX := Replace( StrX, "seventy", "soixante-dix");
StrX := Replace( StrX, "eighty-one", "quatre-vingt-un");
StrX := Replace( StrX, "eighty-two", "quatre-vingt-deux");
StrX := Replace( StrX, "eighty-three", "quatre-vingt-trois");
StrX := Replace( StrX, "eighty-four", "quatre-vingt-quatre");
StrX := Replace( StrX, "eighty-five", "quatre-vingt-cinq");
StrX := Replace( StrX, "eighty-six", "quatre-vingt-six");
StrX := Replace( StrX, "eighty-seven", "quatre-vingt-sept");
StrX := Replace( StrX, "eighty-eight", "quatre-vingts-huit");
StrX := Replace( StrX, "eighty-nine", "quatre-vingt-neuf");
StrX := Replace( StrX, "eighty", "quatre-vingts");
StrX := Replace( StrX, "ninety-one", "quatre-vingt-onze");
StrX := Replace( StrX, "ninety-two", "quatre-vingt-douze");
StrX := Replace( StrX, "ninety-three", "quatre-vingt-treize");
StrX := Replace( StrX, "ninety-four", "quatre-vingt-quatorze");
StrX := Replace( StrX, "ninety-five", "quatre-vingt-quinze");
StrX := Replace( StrX, "ninety-six", "quatre-vingt-seize");
StrX := Replace( StrX, "ninety-seven", "quatre-vingt-dix-sept");
StrX := Replace( StrX, "ninety-eight", "quatre-vingt-dix-huit");
StrX := Replace( StrX, "ninety-nine", "quatre-vingt-dix-neuf");
StrX := Replace( StrX, "ninety", "quatre-vingt-dix");
StrX := Replace( StrX, "eleven", "onze");
StrX := Replace( StrX, "twelve", "douze");
StrX := Replace( StrX, "thirteen", "trieze");
StrX := Replace( StrX, "fourteen", "quartoze");
StrX := Replace( StrX, "fifteen", "quinze");
StrX := Replace( StrX, "sixteen", "seize");
StrX := Replace( StrX, "seventeen", "dix-sept");
StrX := Replace( StrX, "eighteen", "dix-huit");
StrX := Replace( StrX, "nineteen", "dix-neuf");
StrX := Replace( StrX, "one", "un");
StrX := Replace( StrX, "two", "deux");
StrX := Replace( StrX, "three", "trois");
StrX := Replace( StrX, "four", "quatre");
StrX := Replace( StrX, "five", "cinq");
StrX := Replace( StrX, "six", "six");
StrX := Replace( StrX, "seven", "sept");
StrX := Replace( StrX, "eight", "huit");
StrX := Replace( StrX, "nine", "neuf");
StrX := Replace( StrX, "ten", "dix");
//StrX := Replace( StrX, "and", "Dirhams et");
//StrX := Replace( StrX, "-", " ");
StrX := Replace( StrX, "and xx / 100", " ");
Propercase(left(StrX,1)) +Right(StrX, length(StrX)-1)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|