words-to-numbers
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "words-to-numbers", | ||
"description": "convert textual words to numbers with optional fuzzy text matching", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "options": { |
@@ -17,17 +17,24 @@ # Words To Numbers | ||
import wordsToNumbers from 'words-to-numbers'; | ||
wordsToNumbers('one hundred'); //100; | ||
wordsToNumbers('one hundred and five'); //105; | ||
wordsToNumbers('one hundred and twenty five'); //125; | ||
wordsToNumbers('four thousand and thirty'); //4030; | ||
wordsToNumbers('six million five thousand and two'); //6005002; | ||
wordsToNumbers('a thousand one hundred and eleven'); //1111; | ||
wordsToNumbers('twenty thousand five hundred and sixty nine'); //20569; | ||
wordsToNumbers('five quintillion'); //5000000000000000000; | ||
wordsToNumbers('one-hundred'); //100; | ||
wordsToNumbers('one-hundred and five'); //105; | ||
wordsToNumbers('one-hundred and twenty-five'); //125; | ||
wordsToNumbers('four-thousand and thirty'); //4030; | ||
wordsToNumbers('six-million five-thousand and two'); //6005002; | ||
wordsToNumbers('a thousand, one-hundred and eleven'); //1111; | ||
wordsToNumbers('twenty-thousand, five-hundred and sixty-nine'); //20569; | ||
wordsToNumbers('one hundred'); //100 | ||
wordsToNumbers('one hundred and five'); //105 | ||
wordsToNumbers('one hundred and twenty five'); //125 | ||
wordsToNumbers('four thousand and thirty'); //4030 | ||
wordsToNumbers('six million five thousand and two'); //6005002 | ||
wordsToNumbers('a thousand one hundred and eleven'); //1111 | ||
wordsToNumbers('twenty thousand five hundred and sixty nine'); //20569 | ||
wordsToNumbers('five quintillion'); //5000000000000000000 | ||
wordsToNumbers('one-hundred'); //100 | ||
wordsToNumbers('one-hundred and five'); //105 | ||
wordsToNumbers('one-hundred and twenty-five'); //125 | ||
wordsToNumbers('four-thousand and thirty'); //4030 | ||
wordsToNumbers('six-million five-thousand and two'); //6005002 | ||
wordsToNumbers('a thousand, one-hundred and eleven'); //1111 | ||
wordsToNumbers('twenty-thousand, five-hundred and sixty-nine'); //20569 | ||
``` | ||
## Multiple numbers in a string | ||
Returns a string with all instances replaced. | ||
```javascript | ||
wordsToNumbers('there were twenty-thousand, five-hundred and sixty-nine X in the five quintillion Y')) // 'there were 20569 X in the 5000000000000000000 Y' | ||
@@ -38,2 +45,4 @@ ``` | ||
Uses [Jaro distance](http://yomguithereal.github.io/clj-fuzzy/javascript.html#jaro) to find the best match for the number words. Don't rely on this being completely accurate... | ||
```javascript | ||
@@ -40,0 +49,0 @@ import wordsToNumbers from 'words-to-numbers'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17317
67