0
Calculation with rounding to an integer
Options for calculating the percentage with rounding to an integer
2 odpowiedzi
+ 1
int b = (int) Math.round(a);
https://www.sololearn.com/discuss/2155764/?ref=app
0
The task is elementary and classical, calculate the discount on the product. That 's the formula I used to calculate:
price-Math.Floor(price/100.0*discount)
But I think there are probably more compact and beautiful options. Who thinks what? We can discuss it...