Click or drag to resize
GeneralFormat Enumeration
Specifies a general format that is applied to a numeric, text, or any field result. A field may have a combination of general formats.

Namespace: Aspose.Words.Fields
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
Syntax
public enum GeneralFormat
Members
  Member nameValueDescription
None0 Used to specify a missing general format.
Aiueo1 Numeric formatting. Formats a numeric result using hiragana characters in the traditional a-i-u-e-o order.
UppercaseAlphabetic2 Numeric formatting. Formats a numeric result as one or more occurrences of an uppercase alphabetic Latin character.
LowercaseAlphabetic3 Numeric formatting. Formats a numeric result as one or more occurrences of an lowercase alphabetic Latin character.
Arabic4 Numeric formatting. Formats a numeric result using Arabic cardinal numerals.
ArabicAbjad5 Numeric formatting. Formats a numeric result using ascending Abjad numerals.
ArabicAlpha6 Numeric formatting. Formats a numeric result using characters in the Arabic alphabet.
ArabicDash7 Numeric formatting. Formats a numeric result using Arabic cardinal numerals, with a prefix of "- " and a suffix of " -".
BahtText8 Numeric formatting. Formats a numeric result in the Thai counting system.
CardText9 Numeric formatting. Cardinal text (One, Two, Three, ...).
ChineseNum110 Numeric formatting. Formats a numeric result using ascending numbers from the appropriate counting system.
ChineseNum211 Numeric formatting. Formats a numeric result using sequential numbers from the appropriate legal format.
ChineseNum312 Numeric formatting. Formats a numeric result using sequential numbers from the appropriate counting thousand system.
Chosung13 Numeric formatting. Formats a numeric result using sequential numbers from the Korean Chosung format.
CircleNum14 Numeric formatting. Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character for numbers in the range 1–20.
DBChar15 Numeric formatting. Formats a numeric result using double-byte Arabic numbering.
DBNum116 Numeric formatting. Formats a numeric result using sequential digital ideographs, using the appropriate character.
DBNum217 Numeric formatting. Formats a numeric result using sequential numbers from the appropriate counting system.
DBNum318 Numeric formatting. Formats a numeric result using sequential numbers from the appropriate legal counting system.
DBNum419 Numeric formatting. Formats a numeric result using sequential numbers from the appropriate digital counting system.
DollarText20 Numeric formatting. Dollar text (One, Two, Three, ... + AND 55/100).
Ganada21 Numeric formatting. Formats a numeric result using sequential numbers from the Korean Ganada format.
GB122 Numeric formatting. Formats a numeric result using decimal numbering followed by a period, using the enclosed alphanumeric glyph character.
GB223 Numeric formatting. Formats a numeric result using decimal numbering enclosed in parenthesis, using the enclosed alphanumeric glyph character.
GB324 Numeric formatting. Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character.
GB425 Numeric formatting. Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character.
Hebrew126 Numeric formatting. Formats a numeric result using Hebrew numerals.
Hebrew227 Numeric formatting. Formats a numeric result using the Hebrew alphabet.
Hex28 Numeric formatting. Formats the numeric result using uppercase hexadecimal digits.
HindiArabic29 Numeric formatting. Formats a numeric result using Hindi numbers.
HindiCardText30 Numeric formatting. Formats a numeric result using sequential numbers from the Hindi counting system.
HindiLetter131 Numeric formatting. Formats a numeric result using Hindi vowels.
HindiLetter232 Numeric formatting. Formats a numeric result using Hindi consonants.
Iroha33 Numeric formatting. Formats a numeric result using the Japanese iroha.
KanjiNum134 Numeric formatting. Formats a numeric result using a Japanese style using the appropriate counting system.
KanjiNum235 Numeric formatting. Formats a numeric result using the appropriate counting system.
KanjiNum336 Numeric formatting. Formats a numeric result using the appropriate counting system.
Ordinal37 Numeric formatting. Ordinal (1st, 2nd, 3rd, ...).
OrdText38 Numeric formatting. Ordinal text (First, Second, Third, ...).
UppercaseRoman39 Numeric formatting. Uppercase Roman (I, II, III, ...).
LowercaseRoman40 Numeric formatting. Lowercase Roman (i, ii, iii, ...).
SBChar41 Numeric formatting. Formats a numeric result using single-byte Arabic numbering.
ThaiArabic42 Numeric formatting. Formats a numeric result using Thai numbers.
ThaiCardText43 Numeric formatting. Formats a numeric result using sequential numbers from the Thai counting system.
ThaiLetter44 Numeric formatting. Formats a numeric result using Thai letters.
VietCardText45 Numeric formatting. Formats a numeric result using Vietnamese numerals.
Zodiac146 Numeric formatting. Formats a numeric result using sequential numerical traditional ideographs.
Zodiac247 Numeric formatting. Formats a numeric result using sequential zodiac ideographs.
Zodiac348 Numeric formatting. Formats a numeric result using sequential traditional zodiac ideographs.
Caps49 Text formatting. Capitalizes the first letter of each word.
FirstCap50 Text formatting. Capitalizes the first letter of the first word.
Lower51 Text formatting. All letters are lowercase.
Upper52 Text formatting. All letters are uppercase.
CharFormat53 Field result formatting. The CHARFORMAT instruction.
MergeFormat54 Field result formatting. The MERGEFORMAT instruction.
MergeFormatInet55 Field result formatting. The MERGEFORMATINET instruction.
Examples
Shows how to format fields
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Use a document builder to insert field with no format
Field field = builder.InsertField("= 2 + 3");

// We can format our field here instead of in the field code
FieldFormat format = field.Format;
format.NumericFormat = "$###.00";
field.Update();

// Apply a date/time format
field = builder.InsertField("DATE");
format = field.Format;
format.DateTimeFormat = "dddd, MMMM dd, yyyy";
field.Update();

// Apply 2 general formats at the same time
field = builder.InsertField("= 25 + 33");
format = field.Format;
format.GeneralFormats.Add(GeneralFormat.LowercaseRoman);
format.GeneralFormats.Add(GeneralFormat.Upper);
field.Update();

int index = 0;
using (IEnumerator<GeneralFormat> generalFormatEnumerator = format.GeneralFormats.GetEnumerator())
{
    while (generalFormatEnumerator.MoveNext())
    {
        Console.WriteLine($"General format index {index++}: {generalFormatEnumerator.Current}");
    }
}

Assert.AreEqual("LVIII", field.Result);
Assert.AreEqual(2, format.GeneralFormats.Count);
Assert.AreEqual(GeneralFormat.LowercaseRoman, format.GeneralFormats[0]);

// Removing field formats
format.GeneralFormats.Remove(GeneralFormat.LowercaseRoman);
format.GeneralFormats.RemoveAt(0);
Assert.AreEqual(0, format.GeneralFormats.Count);
field.Update();

// Our field has no general formats left and is back to default form
Assert.AreEqual("58", field.Result);
See Also