Tried that Lonkero, but it is still not working. I've added a line to print the result of $size_part, and it falls over when this value contains 2.66. Could it be the floating value that is causing the problem do you think?