I need to calculate the cost of the received time, if there is a price for 1 day. I do as follows:
long hoursDays = diff/(60*60*1000); long priceHour = Long.valueOf(etPriceZas.getText().toString()); long result1 = priceHour/24; long result = result1 * hoursDays;
First, I get the amount of time in hours, then I divide the cost per day by 24 hours and multiply the resulting numbers by each other.
But the trouble is, if I enter the price per day in 1200, then everything is correct, and if 1000 - after all calculations, it gives out - 984 rubles in 24 hours.
How can this be fixed?