Skip to content

Commit

Permalink
Higher precision for the volatility-display in the 'Player Edit'.
Browse files Browse the repository at this point in the history
With only two digits after the dot, the volatility looked the same for almost every player.

Also corrected typo, it is 'Dr. Mark E. Glickman. Yikes.
  • Loading branch information
ThatCraws committed Jan 12, 2019
1 parent 9fdd1eb commit a402cde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions PR Tool/GUI/WinPlayerEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "wx/listctrl.h"
#include <cctype>
#include <sstream>

WinPlayerEdit::WinPlayerEdit(wxWindow* parent, wxWindowID winid, wxArrayString choices)
:wxPanel(parent, winid), mainAliases(choices) {
Expand Down Expand Up @@ -172,10 +173,13 @@ bool WinPlayerEdit::getHidden() const {
}

void WinPlayerEdit::setStats(double rating, double deviation, double volatility, unsigned int wins, unsigned int losses, unsigned int ties) {
std::ostringstream volParse;
volParse.precision(7);
volParse << volatility;

ratingVal->SetLabel(wxString(std::to_string(rating).substr(0, std::to_string(rating).find_last_of('.'))));
deviationVal->SetLabel(wxString(std::to_string(deviation).substr(0, std::to_string(deviation).find_last_of('.'))));
volatilityVal->SetLabel(wxString(std::to_string(volatility).substr(0, std::to_string(volatility).find_last_of('.') + 3)));
deviationVal->SetLabel(wxString(std::to_string(deviation).substr(0, std::to_string(deviation).find_last_of('.') + 3)));
volatilityVal->SetLabel(wxString(volParse.str()));

setCountVal->SetLabel(wxString(
std::to_string(wins) +
Expand Down
2 changes: 1 addition & 1 deletion PR Tool/GUI/WinSetAbt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ WinSetAbt::WinSetAbt(wxWindow* parent, wxWindowID winID, double rating, double d
// -=========== About ==========-
wxStaticBoxSizer* aboutSizer = new wxStaticBoxSizer(wxVERTICAL, this, wxString("About"));
wxTextCtrl* aboutText = new wxTextCtrl(this, wxID_ANY, wxString(
"The PR Tool is designed to create Power Rankings using the Glicko-2 algorithm by Mark E. Glickoman and importing results from challonge-brackets.\n\n"
"The PR Tool is designed to create Power Rankings using the Glicko-2 algorithm by Dr. Mark E. Glickman and importing results from challonge-brackets.\n\n"
"GUI created using wxWidgets\n"
".json-file management done using JsonCpp\n"
"Networking done using libcurl\n"
Expand Down

0 comments on commit a402cde

Please sign in to comment.