# What is the weight service

The weight service is used to normalize weights into the store's base unit (`g` by default) as well as convert between different units.

## Units

By default the weight service has the following units:

- `g`
- `oz`
- `lb`
- `kg`

### Adding a Unit

Use `addUnit()` to add a unit, for example we can add milligrams:

```php
\Aero\Common\Facades\Weight::addUnit('mg', 'mg')
    ->setNormalizer(function ($value) {
        return $value / 1000;
    });
```

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

### Removing a Unit

```php
\Aero\Common\Facades\Weight::removeUnit('kg');
```

### 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\Weight::convert(1000, 'oz', 'g');

\Aero\Common\Facades\Weight::normalize('oz', 1000);
```

### Setting a base Unit

```php
\Aero\Common\Facades\Weight::setBaseUnit('oz');
```

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