Assembly: GemBox.Document (in GemBox.Document.dll) Version: 21.3.30.1113
public CultureInfo DefaultFormattingCulture { get; set; }
Field Value
The default formatting culture used when formatting field values.Default value is InvariantCulture.
GemBox.Document supports date and time formatting field switch (\@) and numeric formatting field switch (\#).
GemBox.Document additionally supports culture info field switch (\ci) which is used to specify CultureInfo that will be used when formatting field value.
Possible \ci switch arguments are:
- Current - culture CurrentCulture will be used in formatting.
- CurrentUI - culture CurrentUICulture will be used in formatting.
- InstalledUI - culture InstalledUICulture will be used in formatting.
- Invariant - culture InvariantCulture will be used in formatting.
- Culture name as specified in Name documentation - culture with specified name will be used in formatting.
If culture info field switch (\ci) is not present in the field's instruction text, then DefaultFormattingCulture will be used when formatting field value.
To view or add field switches with Microsoft Word, press Alt + F9 to toggle field codes. For example, following Word document field code { MERGEFIELD Date \@ "yyyy-MM-dd" \ci "en-US" } represents merge field with name Date, date/time formatting switch \@ with argument yyyy-MM-dd and culture info switch \ci with argument en-US. |
Formatting process uses IFormattable interface to format the value, if date / time formatting field switch (\@) or numeric formatting field switch (\#) is present in the field's instruction text, otherwise IConvertible interface is used.