# Units & figures

One canonical unit per measure, and how figures measured under a test cycle are chosen and ranked.

## Units

Every quantity is in one unit, whatever the source published. Where a field holds a bare number, its name carries the unit.

| Quantity | Unit | Where |
|---|---|---|
| Length | mm | `dimensions_mm`, `length_mm` |
| Weight | kg | `weights_kg`, `kerb_weight_kg` |
| Volume | litres | `capacities_l`, `boot_min_l` |
| Displacement | cm3 | `engine.displacement`, `displacement_cc` |
| Power | kW, with hp beside it | `output.power`, `power_kw`, `power_hp` |
| Torque | Nm | `output.torque`, `torque_nm` |
| Speed | km/h | `performance.top_speed`, `top_speed_kmh` |
| Acceleration | seconds | `acceleration_0_100`, `accel_0_100_s` |
| Battery capacity | kWh | `electric.battery`, `battery_net_kwh` |
| Electric range | km | `efficiency.electric_range` |
| Fuel consumption | l/100km, or kg/100km for CNG and hydrogen | `efficiency.fuel_consumption` |
| Energy consumption | kWh/100km | `efficiency.energy_consumption` |
| CO2 | g/km | `efficiency.co2` |

Dates are ISO 8601: `2024-04-01`. Instants are UTC.

## Power in kW and hp

Power is stored in kW. The `hp` beside it is the figure the manufacturer published, kept because that is the number people quote, so it is not always the exact conversion of the kW.

## Published and calculated

A figure that was derived rather than published says so. Acceleration carries a `source` of `published` or `calculated`: the 0 to 60 mph time is usually calculated from the 0 to 100 km/h one.

## Test-cycle figures

Range, consumption, energy use and CO2 depend on the test cycle, and a version often has more than one figure for a measure. Each measure therefore comes as a block:

```json
{
  "preferred": { "value": 5.3, "unit": "l/100km", "cycle": "wltp" },
  "measurements": [
    { "value": 5.3, "unit": "l/100km", "cycle": "wltp" },
    { "value": 4.6, "unit": "l/100km", "cycle": "nedc" }
  ]
}
```

`measurements` holds every figure, best first. `preferred` is the first of them, and it is the one the filters, the sort keys and the flat shape use.

The ranking is by cycle, in this order: `wltp`, `wltc`, `cltc`, `epa`, unlabelled, `nedc`, `nedc_equivalent`. An unlabelled figure ranks above the older NEDC ones. For a car that takes two fuels, the figure for its primary fuel ranks first.

## Ranges

A figure published as a range, 5.1 to 5.4 l/100km, keeps both ends and gets one number to compare by:

```json
{ "value": 5.25, "min": 5.1, "max": 5.4, "unit": "l/100km", "cycle": "wltp" }
```

`value` is the midpoint. A figure that was published as one number has no `min` or `max`.

## Liquid and gas fuels

Petrol, diesel and the other liquids are measured in l/100km. CNG and hydrogen are measured in kg/100km. The two are never compared: `fuel_consumption_l_100km` filters and sorts only versions whose preferred figure is in litres, and `fuel_consumption_kg_100km` only those in kilograms.

## Options

Doors, seats and tyres can differ within one version, so they come as the options offered rather than one value: `"doors": { "options": [3, 5] }`.
