# What is the volume service?

The volume service is used to normalize volumes into the store's base unit (`cm^3` by default) as well as convert between different units.

## Units

By default the volume service has the following units:

- `mm^3`
- `cm^3`
- `m^3`

### Adding a Unit

Use `addUnit()` to add a unit, for example we can add millilitres &amp; litres:

```php
\Aero\Common\Facades\Volume::addUnit('ml', 'ml');

\Aero\Common\Facades\Volume::addUnit('l', 'L')
    ->setNormalizer(function ($value) {
        return $value * 1000;
    });
```

<p class="callout info">`setNormalizer` defines how to get from that unit to the base unit, which is cm^3.</p>

### Removing a Unit

```php
\Aero\Common\Facades\Volume::removeUnit('m^3');
```

### Converting between Units

You can use `convert()` to convert between any two units, or `normalize()` to convert into the store's base unit.

```php
\Aero\Common\Facades\Volume::convert(1000, 'mm^3', 'cm^3');

\Aero\Common\Facades\Volume::normalize('mm^3', 1000);
```

### Setting a base Unit

```php
\Aero\Common\Facades\Volume::setBaseUnit('ml');
```

<p class="callout info">When you change base unit, database values will still remain in cm^3. But volumes will be displayed in the new unit on screens such as the fulfillment create page.</p>