use cleaner code for handling float rounding in vfprintf