Ejemplo n.º 1
0
        // Token: 0x06000179 RID: 377 RVA: 0x000074B0 File Offset: 0x000056B0
        private static void CollectHundreds(ICollection <string> parts, ref int number, int d, string form, bool pluralize)
        {
            if (number < d)
            {
                return;
            }
            int result = number / d;

            if (result == 1)
            {
                parts.Add(form);
            }
            else
            {
                parts.Add(FrenchNumberToWordsConverterBase.GetUnits(result, GrammaticalGender.Masculine));
                if (number % d == 0 && pluralize)
                {
                    parts.Add(form + "s");
                }
                else
                {
                    parts.Add(form);
                }
            }
            number %= d;
        }
Ejemplo n.º 2
0
        // Token: 0x0600017D RID: 381 RVA: 0x000075B0 File Offset: 0x000057B0
        protected virtual void CollectPartsUnderAHundred(ICollection <string> parts, ref int number, GrammaticalGender gender, bool pluralize)
        {
            if (number < 20)
            {
                parts.Add(FrenchNumberToWordsConverterBase.GetUnits(number, gender));
                return;
            }
            int    units = number % 10;
            string tens  = this.GetTens(number / 10);

            if (units == 0)
            {
                parts.Add(tens);
                return;
            }
            if (units == 1)
            {
                parts.Add(tens);
                parts.Add("et");
                parts.Add(FrenchNumberToWordsConverterBase.GetUnits(1, gender));
                return;
            }
            parts.Add(string.Format("{0}-{1}", new object[]
            {
                tens,
                FrenchNumberToWordsConverterBase.GetUnits(units, gender)
            }));
        }
 // Token: 0x06000173 RID: 371 RVA: 0x00007270 File Offset: 0x00005470
 protected override void CollectPartsUnderAHundred(ICollection <string> parts, ref int number, GrammaticalGender gender, bool pluralize)
 {
     if (number == 71)
     {
         parts.Add("soixante et onze");
         return;
     }
     if (number == 80)
     {
         parts.Add(pluralize ? "quatre-vingts" : "quatre-vingt");
         return;
     }
     if (number >= 70)
     {
         int @base = (number < 80) ? 60 : 80;
         int units = number - @base;
         int tens  = @base / 10;
         parts.Add(string.Format("{0}-{1}", new object[]
         {
             this.GetTens(tens),
             FrenchNumberToWordsConverterBase.GetUnits(units, gender)
         }));
         return;
     }
     base.CollectPartsUnderAHundred(parts, ref number, gender, pluralize);
 }
Ejemplo n.º 4
0
 // Token: 0x0600017B RID: 379 RVA: 0x00007558 File Offset: 0x00005758
 private void CollectPartsUnderAThousand(ICollection <string> parts, int number, GrammaticalGender gender, bool pluralize)
 {
     FrenchNumberToWordsConverterBase.CollectHundreds(parts, ref number, 100, "cent", pluralize);
     if (number > 0)
     {
         this.CollectPartsUnderAHundred(parts, ref number, gender, pluralize);
     }
 }