Table of Contents

Method ToAlphabetic

Namespace
DocWright.Dom.Fields
Assembly
DocWright.Dom.dll

ToAlphabetic(long, bool)

Converts a number to Word's alphabetic counter: 1–26 are A–Z, and beyond that the letter repeats (27 is AA, 28 is BB) rather than carrying like a spreadsheet column.

public static string ToAlphabetic(long value, bool uppercase)

Parameters

value long

The value.

uppercase bool

Whether to use uppercase letters.

Returns

string

The alphabetic counter.

Remarks

The counter's length grows with the value, so it is bounded: a value below 1, or one whose counter would be longer than thirty letters (a value above 780), has no alphabetic form and is returned as digits. The bound is a limit on the expansion, not a measured Word rule; layout applies the same one to a lettered list and to the fields it evaluates.