Getting value using percent and rounding down
-
28-09-2022 - |
Domanda
I have a few values
Quantity := 5;
Quantity2 := 8;
percent :=50;
so i want
Percent of Quantity + Quantity 2
which would be like : 50% of 13 = 6.5
I done it like this
HowMuchDamage := trunc(percent*(Quantity + Quantity2)/100);
How can i make it round up? How can i make it round down?
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow