Skip to content

Commit

Permalink
fix: add includes of ignore one for words
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Chaumet committed Mar 24, 2022
1 parent e123def commit a289892
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions __tests__/fr-FR.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const testIntegers = [
[4680, 'Quatre Mille Six Cent Quatre-Vingt'],
[63892, 'Soixante-Trois Mille Huit Cent Quatre-Vingt-Douze'],
[792581, 'Sept Cent Quatre-Vingt-Douze Mille Cinq Cent Quatre-Vingt-Un'],
[1342823, 'Un Million Trois Cent Quarante-Deux Mille Huit Cent Vingt-Trois'],
[2741034, 'Deux Millions Sept Cent Quarante Et Un Mille Trente-Quatre'],
[86429753, 'Quatre-Vingt-Six Millions Quatre Cent Vingt-Neuf Mille Sept Cent Cinquante-Trois'],
[975310864, 'Neuf Cent Soixante-Quinze Millions Trois Cent Dix Mille Huit Cent Soixante-Quatre'],
Expand Down
2 changes: 1 addition & 1 deletion src/ToWords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export class ToWords {
if (quotient > 1 && locale.config?.pluralWords?.find((word) => word === match.value) && locale.config?.pluralMark) {
matchValue += locale.config.pluralMark;
}
if (quotient === 1 && locale.config?.ignoreOneForWords) {
if (quotient === 1 && locale.config?.ignoreOneForWords?.includes(matchValue)) {
words.push(matchValue);
} else {
words.push(...this.convertInternal(quotient), matchValue);
Expand Down

0 comments on commit a289892

Please sign in to comment.