Fix casting issues

This commit is contained in:
Mathias Gumz 2015-01-16 10:52:38 +01:00
parent 772ec14595
commit 5ede399d4d

View file

@ -26,11 +26,11 @@ namespace FbTk {
namespace RelCalcHelper {
int calPercentageValueOf(int i, int j) {
return floor(i * j / 100 + 0.5);
return static_cast<int>(floor((static_cast<float>(i*j) / 100) + 0.5));
}
int calPercentageOf(int i, int j) {
return floor((float) i / (float) j * 100 + 0.5);
return static_cast<int>(floor((float) i / (float) j * 100 + 0.5));
}
}