@@ 80-86 (lines=7) @@ | ||
77 | $parts = []; |
|
78 | $words = []; |
|
79 | ||
80 | foreach (array_reverse(static::$exponents, true) as $word_number => $word) { |
|
81 | if ($number >= $word_number) { |
|
82 | $count = (int)floor($number / $word_number); |
|
83 | $number = $number % ($count * $word_number); |
|
84 | $parts[] = static::generate($count).' '.static::generate($word_number).($word_number != 100 && $number > 0 ? ',' : null); |
|
85 | } |
|
86 | } |
|
87 | ||
88 | foreach (array_reverse(static::$words, true) as $word_number => $word) { |
|
89 | if ($number >= $word_number) { |
@@ 60-66 (lines=7) @@ | ||
57 | ||
58 | $original_number = $number; |
|
59 | ||
60 | foreach (array_reverse(CardinalNumeralGenerator::$exponents, true) as $word_number => $word) { |
|
61 | if ($number >= $word_number) { |
|
62 | $count = (int)floor($number / $word_number); |
|
63 | $number = $number % ($count * $word_number); |
|
64 | $parts[] = CardinalNumeralGenerator::generate($count).' '.CardinalNumeralGenerator::generate($word_number).($word_number != 100 && $number > 0 ? ',' : null); |
|
65 | } |
|
66 | } |
|
67 | ||
68 | foreach (array_reverse(CardinalNumeralGenerator::$words, true) as $word_number => $word) { |
|
69 | if ($number >= $word_number) { |