Closed arizzitano closed 2 years ago
By default, wordsToNumbers converts ordinal number words to plain numbers:
wordsToNumbers
wordsToNumbers('One Hundred Sixteenth Congress'); // 116 Congress
This PR adds an option preserveOrdinals to retain the ordinal suffixes, which can be useful for preserving semantic meaning within longer strings:
preserveOrdinals
wordsToNumbers('One Hundred Sixteenth Congress', { preserveOrdinals: true }); // 116th Congress
Thanks for your work on this library!
By default,
wordsToNumbers
converts ordinal number words to plain numbers:This PR adds an option
preserveOrdinals
to retain the ordinal suffixes, which can be useful for preserving semantic meaning within longer strings:Thanks for your work on this library!