Whats a simple way to delete the last two characters of a string?
To convert 245px in 245 just run:
245px
parseInt('245px', 10);
It retains only leading numbers and discards all the rest.