5 kyu
Integer to English
144 of 656Chogos
Description:
For a given positive integer convert it into its English representation. All words are lower case and are separated with one space. No trailing spaces are allowed.
To keep it simple, hyphens and the writing of the word 'and' both aren't enforced. (But if you are looking for some extra challenge, such an output will pass the tests.)
Large number reference: http://en.wikipedia.org/wiki/Names_of_large_numbers (U.S., Canada and modern British)
Input range: 1 -> 10**26
(10**16
for JS)
Examples:
int_to_english(1) == 'one'
int_to_english(10) == 'ten'
int_to_english(25161045656) == 'twenty five billion one hundred sixty one million forty five thousand six hundred fifty six'
or
int_to_english(25161045656) == 'twenty five billion one hundred sixty-one million forty-five thousand six hundred and fifty-six'
Strings
Algorithms
Similar Kata:
Stats:
Created | Jul 18, 2014 |
Published | Jul 18, 2014 |
Warriors Trained | 2077 |
Total Skips | 280 |
Total Code Submissions | 7784 |
Total Times Completed | 656 |
Ruby Completions | 144 |
Python Completions | 330 |
JavaScript Completions | 210 |
Total Stars | 125 |
% of votes with a positive feedback rating | 85% of 126 |
Total "Very Satisfied" Votes | 95 |
Total "Somewhat Satisfied" Votes | 23 |
Total "Not Satisfied" Votes | 8 |