Text to Number

Text to Number

Given a text as input, translate the text into its integer representation. The numbers can range from negative 999,999,999 to positive 999,999,999.Note that the word “hundred” is not used when “thousand” could be. E.g. 1500 is written “one thousand five hundred”, not “fifteen hundred”.

Example 1:


input data:
negative six hundred thirty eight
output:
-638

Example 2:


input data:
two million one hundred seven
output:
2000107
View Java Solution

Seda
Seda Kunda is a web designer and developer with a degree in Computer Science and a great passion for code. Besides code, she enjoys pepperoni pizza, watching the bachelor and sleeping in on Saturdays.
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn