Converting integers to English words
JavaScript (375)

Probably a terrible attempt, but anyway, here goes...

alert(function N(s,z){return O="zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,,fif,,,eigh,,,,twen,,for".split(","),(z?O[s]||O[s-10]||O[s-20]:s&lt;13?N(s,1):s&lt;20?N(s,1)+"teen":s&lt;100?N(a=20+(s/10|0),1)+"ty"+(s%10?" "+N(s%10):""):s&lt;1e3?N(s/100|0)+" hundred"+(s%100?" "+N(s%100):""):s&lt;1e5?N(s/1e3|0)+" thousand"+(s%1e3?" "+N(s%1e3):""):0)||NaN}(prompt()))


Pretty-printed (as a function):

function N(s,z) {
  return O = "zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,,fif,,,eigh,,,,twen,,for".split(","),
      (z? O[s] || O[s-10] || O[s-20]
       : s &lt; 13?  N(s,1)
       : s &lt; 20?  N(s,1) + "teen"
       : s &lt; 100? N(a=20+(s/10|0),1) + "ty" + (s%10?" "+N(s%10):"")
       : s &lt; 1e3?  N(s/100|0) +  " hundred" + (s%100?" "+N(s%100):"")
       : s &lt; 1e5?  N(s/1e3|0) + " thousand" + (s%1e3?" "+N(s%1e3):"") : 0) || NaN
}


Sample conversion (note that it even outputs NaN when out of bounds, i.e. invalid input):

540: five hundred forty
4711: four thousand seven hundred eleven
7382: seven thousand three hundred eighty two
1992: one thousand nine hundred ninety two
hutenosa: NaN
1000000000: NaN
-3: NaN