Table of Contents

MoneyFormatOptions Class

Definition

Namespace
Bodu.Financial
Assembly
Bodu.Financial.dll
Package
Bodu.Financial 1.0.0
Source
MoneyFormatOptions.cs

Configures how a MoneyFormatter renders a monetary value. Translates to the format-specifier vocabulary understood by Money and Money<TCurrency>.

public sealed record MoneyFormatOptions : IEquatable<MoneyFormatOptions>
Inheritance
MoneyFormatOptions
Implements
Inherited Members
Extension Methods

Constructors

MoneyFormatOptions()

public MoneyFormatOptions()

Properties

CurrencyDisplay

Gets how the currency designator is rendered.

public CurrencyDisplay CurrencyDisplay { get; init; }

Property Value

CurrencyDisplay

The configured CurrencyDisplay.

Default

Gets the shared default options: ISO-code designator, current-culture grouping, and the currency's natural minor-unit precision.

public static MoneyFormatOptions Default { get; }

Property Value

MoneyFormatOptions

The default MoneyFormatOptions.

ElideWhenCultureMatches

Gets a value indicating whether the currency designator is elided when the formatting culture's region currency matches the amount's currency.

public bool ElideWhenCultureMatches { get; init; }

Property Value

bool

true to elide the designator on a culture match.

FormatProvider

Gets the culture used to render the numeric component, or null for the current culture.

public IFormatProvider? FormatProvider { get; init; }

Property Value

IFormatProvider

The configured format provider, or null.

IncludeGrouping

Gets a value indicating whether digit-group separators are emitted. Applies to the None presentation; currency presentations group according to the culture.

public bool IncludeGrouping { get; init; }

Property Value

bool

true to include grouping.

MinorUnitsOverride

Gets an explicit fractional-digit count overriding the currency's natural precision, or null to use the currency's minor units.

public int? MinorUnitsOverride { get; init; }

Property Value

int?

The override precision, or null.

Methods

Equals(MoneyFormatOptions?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MoneyFormatOptions? other)

Parameters

other MoneyFormatOptions

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(MoneyFormatOptions?, MoneyFormatOptions?)

public static bool operator ==(MoneyFormatOptions? left, MoneyFormatOptions? right)

Parameters

left MoneyFormatOptions
right MoneyFormatOptions

Returns

bool

operator !=(MoneyFormatOptions?, MoneyFormatOptions?)

public static bool operator !=(MoneyFormatOptions? left, MoneyFormatOptions? right)

Parameters

left MoneyFormatOptions
right MoneyFormatOptions

Returns

bool

Applies to

ProductVersions
.NET8, 10