---
title: Convert numeric digit to alpha representation
summary: Resolves one numeric digit value into the rendered token for the active converter.
status: draft
owner: SAIF DocGen
last_reviewed: 2026-07-30
library: SAIF.Framework.BaseN
reference_type: package
operation_id: OP-BASEN-005
trigger: Encode recursion, formatting flow, or direct `IConverter.ConvertNumericToAlpha` invocation.
---

# Convert numeric digit to alpha representation

This operation maps one numeric digit to the string token the active converter renders. The base implementation returns the plain decimal string; the hex and Excel converters substitute alphabetic digits in its place and enforce their own upper-bound checks before doing so.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-BASEN-005 |
| **Trigger** | Converter digit-rendering request |
| **Inputs** | Integer digit value |
| **Outputs** | String token |
| **Primary components** | `ConverterBase.ConvertNumericToAlpha`, `HexConverter.ConvertNumericToAlpha`, `ExcelConverter.ConvertNumericToAlpha` |
| **Entry point** | `SAIF.Framework.BaseN\ConverterBase.vb` |

## Steps

1. The numeric digit arrives through `IConverter.ConvertNumericToAlpha`.
2. The call dispatches to whichever converter implementation is active.
3. `ConverterBase` returns `input.ToString()` with no base-specific validation — any integer value is accepted as-is.
4. `HexConverter` first rejects values greater than `16` by raising `ConverterException`, then maps `10`-`15` to `A`-`F`; every other accepted value is returned as its decimal string ([BR-001](../business-rules.md#br-001-hexadecimal-digit-must-not-exceed-base-16)).
5. `ExcelConverter` first rejects values greater than `26` by raising `ConverterException`, then converts the accepted value to a letter with `Chr(64 + input).ToString` ([BR-002](../business-rules.md#br-002-excel-base-26-digit-must-not-exceed-base-26)).
6. In a full Excel encode workflow, this operation's raw output is not the final string — `FormatBaseN` still has to rewrite any zero digit before the value reaches the caller in valid bijective spreadsheet-column form ([BR-003](../business-rules.md#br-003-excel-style-base-26-conversion-is-bijective-no-zero-digit)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([ConvertNumericToAlpha called]) --> D1{Converter type}
	D1 -->|Base/Binary/Octal| S1[Return decimal string]
	D1 -->|Hex| S2[Validate upper bound and map A-F]
	D1 -->|Excel| S3[Validate upper bound and map A-Z]
	S1 --> EndOk([Return token])
	S2 --> D2{Value > 16?}
	D2 -->|Yes| EndErr([Raise ConverterException])
	D2 -->|No| EndOk
	S3 --> D3{Value > 26?}
	D3 -->|Yes| EndErr
	D3 -->|No| EndOk
```

## Failure and edge-case behavior

- `ConverterBase` never validates that the supplied digit fits the converter's base; it always returns the decimal string form regardless of magnitude.
- `HexConverter` throws `ConverterException` when the supplied value exceeds `16` ([BR-001](../business-rules.md#br-001-hexadecimal-digit-must-not-exceed-base-16)).
- `ExcelConverter` throws `ConverterException` when the supplied value exceeds `26` ([BR-002](../business-rules.md#br-002-excel-base-26-digit-must-not-exceed-base-26)).
- Calling `ExcelConverter.ConvertNumericToAlpha(0)` directly renders `@`, an artifact of the raw `Chr(64 + input)` mapping. The standard encode flow never exposes this artifact to callers because `FormatBaseN` rewrites zero digits before the string is finalized ([BR-003](../business-rules.md#br-003-excel-style-base-26-conversion-is-bijective-no-zero-digit)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `SAIF.Framework.BaseN\ConverterBase.vb`
- `SAIF.Framework.BaseN\HexConverter.vb`
- `SAIF.Framework.BaseN\ExcelConverter.vb`

