// step 1. read the line
std::string line ;
std::getline(fin, line);
// step 2. use a string stream to extract the number into a float
std::istringstream sstm(line);
float number ;
sstm >> number ;
// step 3. round to nearest whole number
number = std::round( number ) ; // http://en.cppreference.com/w/cpp/numeric/math/round