NSTimeInterval
has sub-millisecond precision. If the dates are one day and a millisecond apart, you would charge the 25-th credit.
Changing the code to do integer division should deal with the problem:
// You do not need sub-second resolution here, because you divide by
// the number of seconds in the hour anyway
NSInteger ti = [endDate timeIntervalSinceDate:startDate];
NSInteger costValue = (ti+3599)/3600;
// At this point, the cost is ready. You do not need a special formatter for it.