# Units of Measurement

The unit field on a material — what it means, the built-in list, and how to add your own (boxes, rolls, hours, anything).

import Term from "~/components/Term.astro";
import { Aside, Steps } from "@astrojs/starlight/components";
import DocUpdated from "~/components/DocUpdated.astro";

Every <Term def="raw-material">material</Term> has a **unit** — the label that appears next to its quantity in bills of materials, work orders, pick lists and execution logs. Assemblified ships with 15 common units (`pcs`, `kg`, `m`, `L`, `m2`, …) and lets you define your own when those don't fit.

The unit itself does not change any arithmetic: a quantity you type is taken at face value in whatever unit the material is in. But it is the first thing an operator reads on a pick list, and the unit's **category** decides which units can be used as a weight — so both are worth getting right.

## On this page

- The built-in unit list
- Adding a custom unit
- System units vs custom units (what you can hide vs delete)
- Categories — and why the weight category is load-bearing
- Common gotchas

## Built-in units

Fifteen units are seeded automatically the first time you launch Assemblified:

| Category | Units                       |
| -------- | --------------------------- |
| Count    | `pcs`                       |
| Weight   | `kg`, `g`, `mg`, `lb`, `oz` |
| Length   | `m`, `cm`, `ft`, `in`, `yd` |
| Volume   | `L`, `mL`, `m3`             |
| Area     | `m2`                        |

Each built-in unit ships with a readable name beside its symbol, so a dropdown reads `pcs (Pieces)`.

## Adding a custom unit

When the built-in list doesn't cover what you need — boxes of 12, rolls, bobbins, hours of labour, sheets, batches — define your own.

<Steps>

1. Go to **Settings → Units** in the settings sidebar. The page is titled **Units & conversions**,
   and the first section on it is **Units of measure**.
2. Click **Add unit**.
3. Fill in:
    - **Symbol** (required, max 16 characters) — what shows in dropdowns and on rows. e.g. `box`,
      `roll`, `hours`.
    - **Name** (required) — the readable label. e.g. `Box of 12`, `Roll`, `Operator hours`.
    - **Category** — see [Categories](#categories) below. Custom units default to **Custom**.
4. Click **Save unit**. The new unit appears in every unit dropdown immediately, alongside the
   built-ins.

</Steps>

If a symbol is already in use, a red message appears under **Symbol** and the dialog keeps your
entries. Choose a different symbol, then save again. Other save failures stay in the dialog with
your entries intact; for a connection error, check your connection before retrying.

The table shows both the symbol and the name, so a dropdown reads `box (Box of 12)`. Built-in units
carry a **System** badge; the **Show hidden units** switch above the table brings hidden ones back
into view.

Editing an existing unit adds an **Active** switch to the dialog — turning it off hides the unit from
dropdowns while leaving it on every material that already uses it.

<span id="saving-a-unit-from-the-restock-grid"></span>

### Saving a unit from the stock adjustment grid

The stock adjustment grid's **More actions → Units** entry and missing-unit prompt let you add a unit without
leaving your draft. The fields are disabled while saving. You can still close the editor; closing does
not undo a save already sent. If saving fails, a red message stays in the dialog and your values remain. Read
the message, adjust the values if needed, then click **Save unit** again. For a connection error, check
your connection first. Closing the dialog clears the message for the next opening. After you save a
missing unit, the conversion dialog opens so you can enter its rate to the material's own unit.
If the unit editor cannot load, dismiss its message to continue working in the grid. Your draft stays in place.

### Creating units while importing materials

You can also create units in flight while [importing materials](/features/raw-materials/import/). If
your file contains unit symbols Assemblified does not recognise, the review step offers a
**Create missing units of measure during import** switch and names them. Turn it on and the symbols
are created as custom units before the materials are saved, so you do not have to abandon the upload
to add them by hand.

## System units vs custom units

The two row types behave differently when you try to delete or rename them:

|                         | System unit (built-in)                                                       | Custom unit                                                      |
| ----------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| Delete for good         | Never. It is hidden instead.                                                 | Yes, but only when no material uses it.                          |
| Hide                    | Yes. It leaves the dropdowns and stays on the materials that already use it. | Yes, and this is what Delete does when a material still uses it. |
| Rename the symbol       | Blocked while any material uses the current symbol.                          | Same.                                                            |
| Rename the display name | Always allowed.                                                              | Same.                                                            |

In practice: deleting a unit that materials still use hides it rather than removing it, so old execution logs and rows that mention it keep reading correctly. Turn **Show hidden units** on to see it again, and re-activate it by editing the row and switching **Active** back on.

<Aside type="caution">
    **Renaming a symbol that is in use is blocked.** The symbol (`kg`, `box`, …) is what every material using the unit stores. Renaming it
    would leave those materials pointing at nothing, so Assemblified refuses and tells you how many materials are in the way. Move those
    materials to another unit first, or hide this unit and create a new one.
</Aside>

## Categories

Each unit has a **category**: Weight, Length, Volume, Area, Count, Temperature, Time, Energy or Custom. A unit you create defaults to **Custom**.

Most of the time the category is just a grouping — it shows as a badge in the table and keeps the conversion editor's lists sensible. **Weight is the exception, and it is load-bearing:**

- The **Weight unit** dropdown on a material offers only units in the **Weight** category, and only
  the active ones. A custom unit you want to weigh things in has to be created in that category.
- The calculated weight of a bill of materials or an assembly BOM is expressed in the **first
  active weight unit** — normally `kg`. Every component's weight is converted into it before the
  total is added up, so a custom weight unit needs a [conversion](/features/raw-materials/unit-conversions/)
  before it can take part in a roll-up.
- The same rule applies to what Assemblified mirrors from Shopify: a Shopify weight whose unit does
  not map onto an active weight unit is skipped rather than written.

Conversions themselves are stored as plain multiplicative factors (`1 kg = 1000 g`). They do one job: when you **change a referenced material's unit**, Assemblified uses the factor to convert that material's existing BOM quantities — see [Unit conversions](/features/raw-materials/unit-conversions/) for the full flow and where to define them. You can add a missing factor inline the moment a unit change needs one. They are **not** applied while you type BOM quantities, and not at execution time: a quantity you type is taken at face value in the material's current unit. So if a bill consumes 0.5 kg of a material stocked in grams, model it as `500 g` directly.

## Where the symbol shows up

After you pick a unit on a material, its symbol appears in:

- **The materials list and the material page** — beside the available quantity and the unit cost.
- **Finished good and assembly BOMs** — beside each component's required quantity.
- **The work-order pick list** — the printed, operator-facing one.
- **Execution logs** — in the material requirements.
- **Build runs** — on the actually-consumed entries.
- **The stock adjustment grid** — it is the unit you are typing in, and you can type in a different one.

Changing the unit on a material re-renders all of these. When the material is **used by** at least one finished good or assembly BOM, Assemblified asks how to apply the change before saving:

- **Convert BOM quantities** (default) — every BOM quantity is recalculated by the conversion factor, so `250 cm` becomes `2.5 m` and the physical requirement is preserved.
- **Convert unit cost** (optional, editable-cost materials only) — recalculates the unit cost for the new unit so the total cost stays put.
- **Change unit only** — the display-only escape hatch: relabels without touching any number.

If no multiplicative conversion exists for the old → new pair, the dialog blocks **Convert** and offers to add the conversion inline (or fall back to **Change unit only**). The 1000× footgun only bites if you deliberately pick **Change unit only** on a `kg → g` switch without also multiplying the quantities yourself.

→ Full walkthrough — defining conversions, the bulk-edit path, and the import (convert-else-fail) behavior: [Unit conversions](/features/raw-materials/unit-conversions/).

## Common gotchas

- **The symbol is what gets stored.** A material records its unit as the symbol (`kg`, `box`), which is why renaming a symbol in use is refused. Keep symbols short and stable, and put the friendly wording in **Name**.
- **Conversions apply when a unit _changes_, not at execution.** A quantity you type into a BOM is taken at face value in the material's current unit. Keep BOM quantities in the same unit the material is stocked in.
- **Deleting a unit in use only hides it.** Old execution logs reference the symbol, so removing `kg` outright would mangle every log that mentions it.
- **Nothing you already have is touched.** Materials already using `kg` / `pcs` and the rest keep working — those values are exactly the seeded units' symbols.

## Where to next

- [Virtual materials](/features/raw-materials/virtual-materials/) — units are most often picked while creating one.
- [Unit conversions](/features/raw-materials/unit-conversions/) — define conversion factors and safely change a referenced material's unit.
- [Weight](/features/raw-materials/weight/) — the weight-category units in action, plus the calculated weight roll-up.
- [Importing materials](/features/raw-materials/import/) — including creating missing units during the upload.
- [Track building cost](/guides/track-building-cost/) — using a custom `hours` unit for labour modelling.
- [Materials overview](/features/raw-materials/overview/) — back to the section root.

<DocUpdated date="2026-10-26" />