Table of Contents

FormattingOptions Class

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/FormattingOptions.cs

Configuration options for IFormatProvider.

public class FormattingOptions : IValidatableParameterObject, IParameterObject
Inheritance
object
FormattingOptions
Implements
Derived

Examples

The following example demonstrates how to configure a with a custom format provider to control numeric formatting.

using System;
using System.Globalization;
using Cuemon;

namespace MyApp.Examples;

public class FormattingOptionsExample
{
    public void Demonstrate()
    {
        var options = new FormattingOptions
        {
            FormatProvider = new CultureInfo("da-DK")
        };

        var value = 1234.56;
        var formatted = value.ToString("N2", options.FormatProvider);

        Console.WriteLine(formatted); // Output depends on the culture (e.g., "1.234,56" for da-DK)

}
}

Constructors

Name Description
FormattingOptions()

Initializes a new instance of the FormattingOptions class.

Properties

Name Description
FormatProvider

Gets or sets the IFormatProvider that provides a mechanism for retrieving an object to control formatting.

Methods

Name Description
ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

See Also