Integer to English Words
Convert a non-negative integer into its English words representation. Break the number into groups of three digits and append the scale word (Thousand, Million, Billion) for each group.
Open official problem prompt ↗Turn a bounded non-negative integer into its exact English-words spelling with correct scale words.
Reading a check aloud: you speak each group of three digits and tack on 'thousand', 'million', and so on.
- Input
- num = 1234567
- Output
- "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"
- Why
- 1234567 splits into 1 (Million), 234 (Thousand), 567, each spelled out and joined with its scale word.
0 <= num <= 2^31 - 1