Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaynagpal authored May 17, 2017
1 parent fbc1716 commit 42842a1
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,34 @@ First you have to import the module using the below code.

Then you can use the **word_to_num** method to convert a number-word to numeric digits, as shown below.
```
print(w2n.word_to_num("two million three thousand nine hundred and eighty four"))
2003984
print(w2n.word_to_num("two million three thousand nine hundred and eighty four"))
2003984
```
```
print(w2n.word_to_num('two point three'))
2.3
print(w2n.word_to_num('two point three'))
2.3
```
```
print(w2n.word_to_num('112'))
112
print(w2n.word_to_num('112'))
112
```
```
print(w2n.word_to_num('point one'))
0.1
print(w2n.word_to_num('point one'))
0.1
```

```
print(w2n.word_to_num('one hundred thirty-five'))
135
print(w2n.word_to_num('one hundred thirty-five'))
135
```
```
print(w2n.word_to_num('million million'))
Error: Redundant number! Please enter a valid number word (eg. two million twenty three thousand and forty nine)
None
print(w2n.word_to_num('million million'))
Error: Redundant number! Please enter a valid number word (eg. two million twenty three thousand and forty nine)
None
```
```
print(w2n.word_to_num('blah'))
Error: No valid number words found! Please enter a valid number word (eg. two million twenty three thousand and forty nine)
None
print(w2n.word_to_num('blah'))
Error: No valid number words found! Please enter a valid number word (eg. two million twenty three thousand and forty nine)
None
```
## Bugs/Errors

Expand Down

0 comments on commit 42842a1

Please sign in to comment.