...and I'm not sure if %.0f is the correct format string. Give %d a try.