Table of Contents

Class FieldNumberText

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

The number-to-text conversions Word's * general format switches perform: roman numerals, alphabetic counters, ordinals and spelled-out numbers.

public static class FieldNumberText
Inheritance
FieldNumberText
Inherited Members

Remarks

The spelled-out forms are English-only, as they are in Word — the switch names (CardText, OrdText, DollarText) select an English rendering regardless of document language, so these are deliberately not culture-sensitive.

Methods

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.

ToCardinalText(long, bool)

Spells a number out in English words, as * CardText does.

ToDollarText(double)

Spells a currency amount out as * DollarText does: the whole part in words, then "and", then the fractional part as hundredths.

ToOrdinal(long, CultureInfo)

Converts a number to an ordinal in digits: 1st, 2nd, 3rd, 4th.

ToOrdinalText(long)

Spells an ordinal out in English words, as * OrdText does.

ToRoman(long, bool)

Converts a number to roman numerals. Values outside 1–3999 have no roman form and are returned as digits, which is what Word does.