From d305b907eefe71f025590579a266c2aef07e8ef1 Mon Sep 17 00:00:00 2001 From: APTX Date: Sat, 8 Aug 2015 20:19:32 +0200 Subject: [PATCH] Try rounding the vote before casting to int. --- localmylist/requesthandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/localmylist/requesthandler.cpp b/localmylist/requesthandler.cpp index f5d8392..62f151a 100644 --- a/localmylist/requesthandler.cpp +++ b/localmylist/requesthandler.cpp @@ -1,5 +1,7 @@ #include "requesthandler.h" +#include + #include "mylist.h" #include "database.h" #include "settings.h" @@ -148,7 +150,7 @@ void RequestHandler::handleMyListUpdates() if (request.vote < 1.0 || request.vote > 10.0) cmd.setValue(-1); else - cmd.setValue(int(request.vote * 100)); + cmd.setValue(static_cast(std::nearbyint(request.vote * 100))); VoteReply *reply = Client::instance()->send(cmd); connect(reply, SIGNAL(replyReady(bool)), this, SLOT(myListUpdateVoteReplyComplete(bool))); -- 2.52.0