Skip to main content

unit_cost

Function unit_cost 

Source
pub fn unit_cost(total_cost: f64, units_delivered: f64) -> Option<f64>
Expand description

Cost per genuine unit of value delivered, such as cost per customer served, per transaction, or per deployment.

total_cost / units_delivered.

§Arguments

  • total_cost — total engineering cost for the period, in any currency unit (typically from total_engineering_cost).
  • units_delivered — count of genuine value units delivered in the same period.

§Returns

The cost per unit, or None if units_delivered is zero.

§Examples

use software_engineering::unit_economics::unit_cost;

assert_eq!(unit_cost(650_000.0, 10_000.0), Some(65.0));
assert_eq!(unit_cost(1.0, 0.0), None);