Skip to content

Units

Units define how quantities are measured in Anchorline.

They give meaning to numbers and ensure that quantities are interpreted consistently across a log.


What a unit represents

A unit describes what a quantity measures.

Common examples include currency, hours, points, or counts. A unit answers the question: what does this number mean.

Without a unit, a number is ambiguous. With a unit, it becomes usable.


Units in balanced logs

Balanced logs always use a unit.

The unit applies to every quantity recorded in the log. This ensures that inflow, outflow, transfers, and adjustments are all measured on the same scale.

For example, a money log might use a currency unit, while a time log might use hours.


Consistency over time

A log uses a single unit to stay coherent.

All events in the log assume that unit when recording quantities. This makes balances comparable across time and prevents mixing incompatible values.

Changing how something is measured should be modeled as a new log, not a silent change of unit.


Custom units

Units are not limited to standard types.

You can define custom units to match your system, such as credits, tokens, points, or internal measures. Custom units behave the same way as built-in ones.

What matters is consistency, not the name of the unit.


Units and presentation

Units affect how quantities are displayed and validated.

They control formatting, precision, and expectations around input, but they do not change recorded history. The meaning of past events stays the same.

Units give context without altering what happened.


When units matter most

Units are especially important when:

  • Tracking movement over time
  • Comparing values across events
  • Reconciling totals
  • Exporting or sharing data

Clear units make logs easier to understand and harder to misuse.


A simple rule

If a number can be misunderstood, it needs a unit.

Anchorline treats units as part of the structure so quantities stay meaningful as systems grow.