Really strange substring problem

I want to retrieve a number from a filename.
I use this code:

[SIZE=1]var fileName = “pos02280.xml”;
var fileNum = Number(fileName.substring(3,8));
trace(fileNum);[/SIZE]

This returns 2280. Without the conversion to a number
it would return ‘02280’.
But when I use another file, for example pos02250.xml
and exactly the same code something really strange
happens…

[SIZE=1]var fileName = “pos02250.xml”;
var fileNum = Number(fileName.substring(3,8));
trace(fileNum);[/SIZE]

Without the number conversion it returns ‘02250’.
But with the conversion it returns 1192 ???

How is this possible? Is it a bug? Am I missing something?