Skip to content

Commit

Permalink
Fixing floating point part display (Ingo's bug notification)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Ains committed Jul 24, 2019
1 parent 0b177e1 commit 83a4cac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/example/CAppDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void CAppDemo::handleRxGpFrame( CGpFrame &i_gpf )
else
{
int16_t value = static_cast<int16_t>(dble_u8_to_u16(i_gpf.getPayload().at(6), i_gpf.getPayload().at(5)));
std::cout << "Temperature: " << value/100 << "." << value%100 << "°C\n";
std::cout << "Temperature: " << value/100 << "." << std::setw(2) << std::setfill('0') << value%100 << "°C\n";
}
}
else
Expand All @@ -150,7 +150,7 @@ void CAppDemo::handleRxGpFrame( CGpFrame &i_gpf )
else
{
int16_t value = static_cast<int16_t>(dble_u8_to_u16(i_gpf.getPayload().at(6), i_gpf.getPayload().at(5)));
std::cout << "Humidity: " << value/100 << "." << value%100 << "%\n";
std::cout << "Humidity: " << value/100 << "." << std::setw(2) << std::setfill('0') << value%100 << "%\n";
}
}
else
Expand Down

0 comments on commit 83a4cac

Please sign in to comment.