Numbertext / libnumbertext

Number to number name and money text conversion libraries in C++, Java, JavaScript and Python & LibreOffice Calc Extension
BSD 3-Clause "New" or "Revised" License
67 stars 46 forks source link

French have #93

Closed 4560041 closed 2 years ago

4560041 commented 2 years ago

Hello and thank you for NUMBERTEXT() and MONEYTEXT() Calc functions! They are very handy! But for French language, they do not respect administrative documents official rules. It's now been over 20 years that the French have to use hyphens instead of spaces in all compound numerals therein. Below is an excerpt of the French Republic Official Journal published on December 6, 1990 (see https://www.vjf.cnrs.fr/orthographe/PDF/JODA.pdf page 14). Would some of you be so kind to provide us with an update respecting these rules. Hoping so and thanking you in advance, with kind regards, @4560041.

6 décembre 1990 Journal officiel de la République française Edition des documents administratifs

Trait d'union : on lie par des traits d'union les numéraux formant un nombre complexe, inférieur ou supérieur à cent.

Exemples : elle a vingt-quatre ans, cet ouvrage date de l'année quatre-vingt-neuf, elle a cent-deux ans, cette maison a deux-cents ans, il lit les pages cent-trente-deux et deux-cent-soixante-et-onze, il possède sept-cent-mille-trois-cent-vingt-et-un francs.

Automatic translation

December 6, 1990 Official Journal of the French Republic Editing of administrative documents

Hyphen: Numerals forming a complex number, less than or greater than one hundred, are linked by hyphens.

Examples: she is twenty-four years old, this work dates from the year eighty-nine, she is one hundred and two years old, this house is two hundred years old, he reads pages one hundred and thirty-two and two hundred seventy-one, he has seven hundred thousand three hundred and twenty-one francs.

4560041 commented 2 years ago

Until then, here is a workaround example for MONEYTEXT(): LOWER(REGEX(MONEYTEXT(A1, "EUR", "fr"), "(?<! et) (?!euros?|et )", "-", "g"))

laszlonemeth commented 2 years ago

Dear Contributor,

Fixed in https://github.com/Numbertext/libnumbertext/commit/88130131146eeef13b3dfd2ef574e90cfac509a5

Next version of libnumbertext and NUMBERTEXT/MONEYTEXT extension will be released this year.

Thanks for the bug report and for the nice workaround!

Best regards, László