# numeric

<a id="numeric"></a>

# numeric

Integer parsing and formatting helpers.

## Functions

| Return | Name | Description |
|--------|------|-------------|
| `void` | [`format`](#format-14)  | Formats an integer value in decimal notation. |
| `void` | [`format`](#format-15)  | Formats an integer value in decimal notation, right justified in a field having at least the specified width. |
| `void` | [`format0`](#format0)  | Formats an integer value in decimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`formatHex`](#formathex)  | Formats an int value in hexadecimal notation. The value is treated as unsigned. |
| `void` | [`formatHex`](#formathex-1)  | Formats an int value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. The value is treated as unsigned. |
| `void` | [`format`](#format-16)  | Formats an unsigned int value in decimal notation. |
| `void` | [`format`](#format-17)  | Formats an unsigned int value in decimal notation, right justified in a field having at least the specified width. |
| `void` | [`format0`](#format0-1)  | Formats an unsigned int value in decimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`formatHex`](#formathex-2)  | Formats an unsigned int value in hexadecimal notation. |
| `void` | [`formatHex`](#formathex-3)  | Formats an unsigned int value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`format`](#format-18)  | Formats a long value in decimal notation. |
| `void` | [`format`](#format-19)  | Formats a long value in decimal notation, right justified in a field having at least the specified width. |
| `void` | [`format0`](#format0-2)  | Formats a long value in decimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`formatHex`](#formathex-4)  | Formats a long value in hexadecimal notation. The value is treated as unsigned. |
| `void` | [`formatHex`](#formathex-5)  | Formats a long value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. The value is treated as unsigned. |
| `void` | [`format`](#format-20)  | Formats an unsigned long value in decimal notation. |
| `void` | [`format`](#format-21)  | Formats an unsigned long value in decimal notation, right justified in a field having at least the specified width. |
| `void` | [`format0`](#format0-3)  | Formats an unsigned long value in decimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`formatHex`](#formathex-6)  | Formats an unsigned long value in hexadecimal notation. |
| `void` | [`formatHex`](#formathex-7)  | Formats an unsigned long value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`format`](#format-22)  | Formats a 64-bit integer value in decimal notation. |
| `void` | [`format`](#format-23)  | Formats a 64-bit integer value in decimal notation, right justified in a field having at least the specified width. |
| `void` | [`format0`](#format0-4)  | Formats a 64-bit integer value in decimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`formatHex`](#formathex-8)  | Formats a 64-bit integer value in hexadecimal notation. The value is treated as unsigned. |
| `void` | [`formatHex`](#formathex-9)  | Formats a 64-bit integer value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. The value is treated as unsigned. |
| `void` | [`format`](#format-24)  | Formats an unsigned 64-bit integer value in decimal notation. |
| `void` | [`format`](#format-25)  | Formats an unsigned 64-bit integer value in decimal notation, right justified in a field having at least the specified width. |
| `void` | [`format0`](#format0-5)  | Formats an unsigned 64-bit integer value in decimal notation, right justified and zero-padded in a field having at least the specified width. |
| `void` | [`formatHex`](#formathex-10)  | Formats an unsigned 64-bit integer value in hexadecimal notation. |
| `void` | [`formatHex`](#formathex-11)  | Formats an unsigned 64-bit integer value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. |

---

<a id="format-14"></a>

### format

```cpp
void format(std::string & str, int value)
```

[Defined in src/base/include/icy/numeric.h:32](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L32)

Formats an integer value in decimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `int` | Value to format. |

---

<a id="format-15"></a>

### format

```cpp
void format(std::string & str, int value, int width)
```

[Defined in src/base/include/icy/numeric.h:39](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L39)

Formats an integer value in decimal notation, right justified in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `int` | Value to format. |
| `width` | `int` | Minimum field width; padded with spaces on the left. |

---

<a id="format0"></a>

### format0

```cpp
void format0(std::string & str, int value, int width)
```

[Defined in src/base/include/icy/numeric.h:46](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L46)

Formats an integer value in decimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `int` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="formathex"></a>

### formatHex

```cpp
void formatHex(std::string & str, int value)
```

[Defined in src/base/include/icy/numeric.h:52](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L52)

Formats an int value in hexadecimal notation. The value is treated as unsigned.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `int` | Value to format. |

---

<a id="formathex-1"></a>

### formatHex

```cpp
void formatHex(std::string & str, int value, int width)
```

[Defined in src/base/include/icy/numeric.h:60](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L60)

Formats an int value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. The value is treated as unsigned.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `int` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="format-16"></a>

### format

```cpp
void format(std::string & str, unsigned value)
```

[Defined in src/base/include/icy/numeric.h:65](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L65)

Formats an unsigned int value in decimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned` | Value to format. |

---

<a id="format-17"></a>

### format

```cpp
void format(std::string & str, unsigned value, int width)
```

[Defined in src/base/include/icy/numeric.h:72](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L72)

Formats an unsigned int value in decimal notation, right justified in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned` | Value to format. |
| `width` | `int` | Minimum field width; padded with spaces on the left. |

---

<a id="format0-1"></a>

### format0

```cpp
void format0(std::string & str, unsigned int value, int width)
```

[Defined in src/base/include/icy/numeric.h:79](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L79)

Formats an unsigned int value in decimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned int` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="formathex-2"></a>

### formatHex

```cpp
void formatHex(std::string & str, unsigned value)
```

[Defined in src/base/include/icy/numeric.h:84](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L84)

Formats an unsigned int value in hexadecimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned` | Value to format. |

---

<a id="formathex-3"></a>

### formatHex

```cpp
void formatHex(std::string & str, unsigned value, int width)
```

[Defined in src/base/include/icy/numeric.h:91](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L91)

Formats an unsigned int value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="format-18"></a>

### format

```cpp
void format(std::string & str, long value)
```

[Defined in src/base/include/icy/numeric.h:96](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L96)

Formats a long value in decimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `long` | Value to format. |

---

<a id="format-19"></a>

### format

```cpp
void format(std::string & str, long value, int width)
```

[Defined in src/base/include/icy/numeric.h:103](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L103)

Formats a long value in decimal notation, right justified in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `long` | Value to format. |
| `width` | `int` | Minimum field width; padded with spaces on the left. |

---

<a id="format0-2"></a>

### format0

```cpp
void format0(std::string & str, long value, int width)
```

[Defined in src/base/include/icy/numeric.h:110](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L110)

Formats a long value in decimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `long` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="formathex-4"></a>

### formatHex

```cpp
void formatHex(std::string & str, long value)
```

[Defined in src/base/include/icy/numeric.h:116](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L116)

Formats a long value in hexadecimal notation. The value is treated as unsigned.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `long` | Value to format. |

---

<a id="formathex-5"></a>

### formatHex

```cpp
void formatHex(std::string & str, long value, int width)
```

[Defined in src/base/include/icy/numeric.h:124](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L124)

Formats a long value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. The value is treated as unsigned.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `long` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="format-20"></a>

### format

```cpp
void format(std::string & str, unsigned long value)
```

[Defined in src/base/include/icy/numeric.h:129](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L129)

Formats an unsigned long value in decimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned long` | Value to format. |

---

<a id="format-21"></a>

### format

```cpp
void format(std::string & str, unsigned long value, int width)
```

[Defined in src/base/include/icy/numeric.h:136](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L136)

Formats an unsigned long value in decimal notation, right justified in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned long` | Value to format. |
| `width` | `int` | Minimum field width; padded with spaces on the left. |

---

<a id="format0-3"></a>

### format0

```cpp
void format0(std::string & str, unsigned long value, int width)
```

[Defined in src/base/include/icy/numeric.h:143](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L143)

Formats an unsigned long value in decimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned long` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="formathex-6"></a>

### formatHex

```cpp
void formatHex(std::string & str, unsigned long value)
```

[Defined in src/base/include/icy/numeric.h:148](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L148)

Formats an unsigned long value in hexadecimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned long` | Value to format. |

---

<a id="formathex-7"></a>

### formatHex

```cpp
void formatHex(std::string & str, unsigned long value, int width)
```

[Defined in src/base/include/icy/numeric.h:155](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L155)

Formats an unsigned long value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `unsigned long` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="format-22"></a>

### format

```cpp
void format(std::string & str, std::int64_t value)
```

[Defined in src/base/include/icy/numeric.h:160](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L160)

Formats a 64-bit integer value in decimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `std::int64_t` | Value to format. |

---

<a id="format-23"></a>

### format

```cpp
void format(std::string & str, std::int64_t value, int width)
```

[Defined in src/base/include/icy/numeric.h:167](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L167)

Formats a 64-bit integer value in decimal notation, right justified in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `std::int64_t` | Value to format. |
| `width` | `int` | Minimum field width; padded with spaces on the left. |

---

<a id="format0-4"></a>

### format0

```cpp
void format0(std::string & str, std::int64_t value, int width)
```

[Defined in src/base/include/icy/numeric.h:174](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L174)

Formats a 64-bit integer value in decimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `std::int64_t` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="formathex-8"></a>

### formatHex

```cpp
void formatHex(std::string & str, std::int64_t value)
```

[Defined in src/base/include/icy/numeric.h:180](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L180)

Formats a 64-bit integer value in hexadecimal notation. The value is treated as unsigned.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `std::int64_t` | Value to format. |

---

<a id="formathex-9"></a>

### formatHex

```cpp
void formatHex(std::string & str, std::int64_t value, int width)
```

[Defined in src/base/include/icy/numeric.h:188](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L188)

Formats a 64-bit integer value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width. The value is treated as unsigned.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `std::int64_t` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="format-24"></a>

### format

```cpp
void format(std::string & str, uint64_t value)
```

[Defined in src/base/include/icy/numeric.h:193](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L193)

Formats an unsigned 64-bit integer value in decimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `uint64_t` | Value to format. |

---

<a id="format-25"></a>

### format

```cpp
void format(std::string & str, uint64_t value, int width)
```

[Defined in src/base/include/icy/numeric.h:200](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L200)

Formats an unsigned 64-bit integer value in decimal notation, right justified in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `uint64_t` | Value to format. |
| `width` | `int` | Minimum field width; padded with spaces on the left. |

---

<a id="format0-5"></a>

### format0

```cpp
void format0(std::string & str, uint64_t value, int width)
```

[Defined in src/base/include/icy/numeric.h:207](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L207)

Formats an unsigned 64-bit integer value in decimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `uint64_t` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |

---

<a id="formathex-10"></a>

### formatHex

```cpp
void formatHex(std::string & str, uint64_t value)
```

[Defined in src/base/include/icy/numeric.h:212](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L212)

Formats an unsigned 64-bit integer value in hexadecimal notation.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `uint64_t` | Value to format. |

---

<a id="formathex-11"></a>

### formatHex

```cpp
void formatHex(std::string & str, uint64_t value, int width)
```

[Defined in src/base/include/icy/numeric.h:219](https://github.com/auscaster/icey/blob/main/src/base/include/icy/numeric.h#L219)

Formats an unsigned 64-bit integer value in hexadecimal notation, right justified and zero-padded in a field having at least the specified width.

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `str` | `std::string &` | Output string to append to. |
| `value` | `uint64_t` | Value to format. |
| `width` | `int` | Minimum field width; padded with zeros on the left. |
