Commit graph

1 commit

Author SHA1 Message Date
Milamber
7b726f654d
FIX: French amount in words (cent/vingt agreement, et, hyphens, mille/million, centimes) (#38945)
Replace the English-structured algorithm (only translated word by word) with a
dedicated French converter for fr_* languages. It handles the French rules the
generic algorithm cannot express:
- elision of "un" before cent/mille (cent, mille, not "un cent"/"un mille")
- agreement of cent/quatre-vingt (deux cents, trois cent soixante, quatre-vingts,
  quatre-vingt mille)
- "et" for 21/31/41/51/61/71 (vingt et un, soixante et onze)
- hyphenation, configurable via CONVERT_TO_WORD_FR (PRE1990 default / REFORME1990)
- plural of million/milliard
Also fix the cents extraction for all languages (0.07 gave "seventy" instead of
"seven") and render the decimal part as "et X centime(s)".

Add a detailed PHPUnit test (100+ French values) in test/phpunit.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-22 14:34:52 +02:00