]>
Commit | Line | Data |
---|---|---|
374ca955 A |
1 | // *************************************************************************** |
2 | // * | |
3 | // * Copyright (C) 2004, International Business Machines | |
4 | // * Corporation and others. All Rights Reserved. | |
5 | // * | |
6 | // *************************************************************************** | |
7 | // | |
8 | ||
9 | fr { | |
10 | ||
11 | //------------------------------------------------------------ | |
12 | // Rule Based Number Format Support | |
13 | //------------------------------------------------------------ | |
14 | ||
15 | // * Spellout rules for French. French adds some interesting quirks of its | |
16 | // * own: 1) The word "et" is interposed between the tens and ones digits, | |
17 | // * but only if the ones digit if 1: 20 is "vingt," and 2 is "vingt-deux," | |
18 | // * but 21 is "vingt-et-un." 2) There are no words for 70, 80, or 90. | |
19 | // * "quatre-vingts" ("four twenties") is used for 80, and values proceed | |
20 | // * by score from 60 to 99 (e.g., 73 is "soixante-treize" ["sixty-thirteen"]). | |
21 | // * Numbers from 1,100 to 1,199 are rendered as hundreds rather than | |
22 | // * thousands: 1,100 is "onze cents" ("eleven hundred"), rather than | |
23 | // * "mille cent" ("one thousand one hundred") | |
24 | ||
25 | SpelloutRules { | |
26 | // the main rule set | |
27 | "%main:\n" | |
28 | "-x: moins >>;\n" | |
29 | "x.x: << virgule >>;\n" | |
30 | // words for numbers from 0 to 10 | |
31 | "z\u00e9ro; un; deux; trois; quatre; cinq; six; sept; huit; neuf;\n" | |
32 | "dix; onze; douze; treize; quatorze; quinze; seize;\n" | |
33 | " dix-sept; dix-huit; dix-neuf;\n" | |
34 | // ords for the multiples of 10: %%alt-ones inserts "et" | |
35 | // when needed | |
36 | "20: vingt[->%%alt-ones>];\n" | |
37 | "30: trente[->%%alt-ones>];\n" | |
38 | "40: quarante[->%%alt-ones>];\n" | |
39 | "50: cinquante[->%%alt-ones>];\n" | |
40 | // rule for 60. The /20 causes this rule's multiplier to be | |
41 | // 20 rather than 10, allowinhg us to recurse for all values | |
42 | // from 60 to 79... | |
43 | "60/20: soixante[->%%alt-ones>];\n" | |
44 | // ...except for 71, which must be special-cased | |
45 | "71: soixante et onze;\n" | |
46 | // at 72, we have to repeat the rule for 60 to get us to 79 | |
47 | "72/20: soixante->%%alt-ones>;\n" | |
48 | // at 80, we state a new rule with the phrase for 80. Since | |
49 | // it changes form when there's a ones digit, we need a second | |
50 | // rule at 81. This rule also includes "/20," allowing it to | |
51 | // be used correctly for all values up to 99 | |
52 | "80: quatre-vingts; 81/20: quatre-vingt->>;\n" | |
53 | // "cent" becomes plural when preceded by a multiplier, and | |
54 | // the multiplier is omitted from the singular form | |
55 | "100: cent[ >>];\n" | |
56 | "200: << cents[ >>];\n" | |
57 | "1000: mille[ >>];\n" | |
58 | // values from 1,100 to 1,199 are rendered as "onze cents..." | |
59 | // instead of "mille cent..." The > after "1000" decreases | |
60 | // the rule's exponent, causing its multiplier to be 100 instead | |
61 | // of 1,000. This prevents us from getting "onze cents cent | |
62 | // vingt-deux" ("eleven hundred one hundred twenty-two"). | |
63 | "1100>: onze cents[ >>];\n" | |
64 | // at 1,200, we go back to formating in thousands, so we | |
65 | // repeat the rule for 1,000 | |
66 | "1200: mille >>;\n" | |
67 | // at 2,000, the multiplier is added | |
68 | "2000: << mille[ >>];\n" | |
69 | "1,000,000: << million[ >>];\n" | |
70 | "1,000,000,000: << milliard[ >>];\n" | |
71 | "1,000,000,000,000: << billion[ >>];\n" | |
72 | "1,000,000,000,000,000: =#,##0=;\n" | |
73 | // %%alt-ones is used to insert "et" when the ones digit is 1 | |
74 | "%%alt-ones:\n" | |
75 | "; et-un; =%main=;\n" | |
76 | "%%lenient-parse:\n" | |
77 | "&\u0000 << ' ' << ',' << '-';\n" | |
78 | } | |
79 | } |