Applied casting

Used casting to treat string like a number.  Tested in browser and
desired result was achieved.