// Count units charged inside one progressive pricing tier with excluded lower and included upper cumulative boundaries. pub fn tier_units(quantity: i64, lower: i64, upper: i64) -> i64 { if quantity<0 || lower<0 || upper