# Units, typed values and expressions

The display units, the syntax of values you type while you draw, and the syntax of project parameter expressions.

The tables and the two test fields on this page use the code of the app.

## Display units

KerfCraft keeps every length in millimetres. The display unit changes only how you see and type lengths. To change it, use **Properties ▸ Units** with nothing selected. The default is `ft-in` for a project in the US / Canada region, and `mm` for other regions. The assistant always works in millimetres.

| Unit | 1219.2 mm on screen | 1219.7 mm in a cut list |
|---|---|---|
| mm | 1219.2 mm | 1219.7 mm |
| cm | 121.9 cm | 121.97 cm |
| m | 1.219 m | 1.2197 m |
| in | 48" | 48"+ |
| ft-in | 4' 0" | 4' 0"+ |

In a cut list, imperial sizes go to the nearest 1/16". A `+` after a size means that the true size is more than 1/64" larger than shown. A `-` means that it is more than 1/64" smaller. The tooltip and the mm columns of the CSV file show the exact millimetres.

## Typed values

While a tool is active, type a value and press **Enter**. The value shows in the box in the status bar, next to the prompt of the tool.

- A number without a unit is in the display unit. With `ft-in`, a number without a unit is in inches.
- Units: `mm`, `cm`, `m`, `in` or `"`, `ft` or `'`. Spaces between the number and the unit are optional.
- Fractions: `3/4`, `6 1/2"`. Feet and inches together: `1' 6 1/2"`, `2ft 3in`. A number after feet is in inches.
- More than one value: separate them with `,`, `;`, `x`, `×`, `*` or a space, for example `600,400` or `600 x 400`.
- A minus sign reverses the direction: `-600,400`.

## Typed values for each tool

These tables are the same as the hover cards on the toolbar. For the keys of each tool, see [Keyboard shortcuts](/docs/reference/keyboard-shortcuts/).

### Select tool

| Type | Action |
|---|---|
| 90 | straight after a ring drag: change the angle (one undo) |

### Rectangle tool

| Type | Action |
|---|---|
| 600,400 | width,depth the way the cursor was dragged |
| -600,400 | width the other way |
| 18 | thickness, up or down as the cursor points |
| 18 · 600,400 · 600,400,12 | straight after: change thickness / size / both (one undo) |

### Line tool

| Type | Action |
|---|---|
| 1200 | segment length along the line to the cursor. A number goes the way the cursor points; a minus reverses it. |
| 18 | after closing: thickness, the side the cursor is on |
| 24 | straight after: change the thickness (one undo) |

### Circle tool

| Type | Action |
|---|---|
| 300 | radius |
| 18 | thickness, the side the cursor is on; −18 the other way |
| 24 | straight after: change the thickness (one undo) |

### Envelope tool

| Type | Action |
|---|---|
| 1620 | segment length along the line to the cursor. A number goes the way the cursor points; a minus reverses it. |
| -1310,0,1010 | an exact x,y,z offset to the next point |
| 745 | after closing: the depth (front view: going back) |

### Push/Pull tool

| Type | Action |
|---|---|
| 3000 | along the face, the side the cursor is on. A number goes the way the cursor points; a minus reverses it. |
| -200 | the other way |
| 500 | straight after a push: redo it at 500 (one undo) |

### Move tool

| Type | Action |
|---|---|
| 600 | along the drag / locked axis. A number goes the way the cursor points; a minus reverses it. |
| 600,0,300 | an exact x,y,z offset |
| 900 | straight after: change the last move (one undo) |
| x3 | straight after a copy: 3 copies in a row |

### Rotate tool

| Type | Action |
|---|---|
| 90 | degrees about the axis |
| -45 | the other way |
| 30 | straight after: change the last rotation (one undo) |

### Timber tool

| Type | Action |
|---|---|
| 2400 | length along the line to the cursor. A number goes the way the cursor points; a minus reverses it. |
| 0,0,2400 | an exact x,y,z offset from the start |
| 3000 | straight after: change the last member (one undo) |

### Measure tool

| Type | Action |
|---|---|
| 1200 | sets the tape to 1200 along its direction. A number goes the way the cursor points; a minus reverses it. |
| 0,600,0 | an exact x,y,z offset |
| 900 | straight after: change that tape |

## Project parameters

Project parameters are named values that other values can refer to. They are in **Properties ▸ Parameters** with nothing selected. To add one, type `name = expression` in the empty field and press **Enter**. The panel shows the value of each parameter after `=`, or `?` when KerfCraft cannot calculate it.

The parameters of a generated assembly, for example a bookcase, also accept expressions. They can refer to project parameters.

### Expression syntax

- Numbers: `600`, `0.5`, `.5`.
- Operators: `+`, `-`, `*`, `/` and brackets. `*` and `/` come before `+` and `-`. A minus sign before a value makes it negative.
- Names: a letter or `_` first, then letters, digits or `_`, for example `shelf_gap`. A name refers to another parameter.
- A number without a unit is in millimetres. The display unit does not change this.
- Parameters can refer to each other in any order. A loop, for example `a = b` and `b = a`, is an error.
- Other errors: an unknown parameter name, an unknown function, division by zero, and a result that is not a finite number.

### Units in expressions

Put the unit after the number: `1.2 m`, `2 ft`.

| Unit | Equals |
|---|---|
| mm | 1 mm |
| cm | 10 mm |
| m | 1000 mm |
| in | 25.4 mm |
| ft | 304.8 mm |

### Functions

| Function | Result |
|---|---|
| min(a, b, …) | the smallest value |
| max(a, b, …) | the largest value |
| round(v, step) | v to the nearest step (step 1 when you leave it out) |
| floor(v, step) | v down to a step |
| ceil(v, step) | v up to a step |
| abs(v) | v without its sign |
| sqrt(v) | the square root of v |

### Test an expression
