Are you sure you're using the modulus operator like you expect?


convert = convert % 1;

after this statement convert will always equal 1 such that convert >= 1
When convert is < 1 convert...