Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelColumnFormatRule

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

Describes one header-based column number format.

Inheritance

  • object
  • ExcelColumnFormatRule

Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Methods

public static ExcelColumnFormatRule FromFormat(string header, string numberFormat, bool includeHeader = false, bool autoFit = false) #

Creates a custom number-format rule.

Parameters

header string required
numberFormat string required
includeHeader bool = false optional
autoFit bool = false optional
public static ExcelColumnFormatRule FromPreset(string header, ExcelNumberPreset preset, int decimals = 2, CultureInfo? culture = null, bool includeHeader = false, bool autoFit = false) #

Creates a preset-based column format rule.

Parameters

header string required
preset OfficeIMO.Excel.ExcelNumberPreset required
decimals int = 2 optional
culture System.Globalization.CultureInfo? = null optional
includeHeader bool = false optional
autoFit bool = false optional
public string ResolveNumberFormat() #

Resolves the Excel number format code for this rule.

Returns

string

Properties

public string Header { get; } #

Header caption used to resolve the column.

public ExcelNumberPreset? Preset { get; } #

Preset number format, when the rule was created from a preset.

public string? NumberFormat { get; } #

Custom number format, when supplied directly.

public int Decimals { get; } #

Decimal places used by preset formats that support precision.

public CultureInfo? Culture { get; } #

Culture used for culture-aware preset formats such as currency.

public bool IncludeHeader { get; } #

Whether the header cell should also receive the format.

public bool AutoFit { get; } #

Whether the resolved column should be auto-fit after formatting.