Fix casting issues
This commit is contained in:
parent
772ec14595
commit
5ede399d4d
1 changed files with 2 additions and 2 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue