Table of Contents

MoneyFormatter Class

Definition

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

Renders Money and Money<TCurrency> values according to a fixed MoneyFormatOptions, translating the options into the format-specifier vocabulary of the monetary types.

public sealed class MoneyFormatter
Inheritance
MoneyFormatter
Inherited Members
Extension Methods

Constructors

MoneyFormatter(MoneyFormatOptions)

Initializes a new instance of the MoneyFormatter class.

public MoneyFormatter(MoneyFormatOptions options)

Parameters

options MoneyFormatOptions

The formatting options.

Exceptions

ArgumentNullException

options is null.

ArgumentOutOfRangeException

options.CurrencyDisplay is not a defined value.

Methods

Format(Money)

Formats a runtime-tagged Money value.

public string Format(Money money)

Parameters

money Money

The value to format.

Returns

string

The formatted string.

Format<TCurrency>(Money<TCurrency>)

Formats a strongly-typed Money<TCurrency> value.

public string Format<TCurrency>(Money<TCurrency> money) where TCurrency : ICurrency

Parameters

money Money<TCurrency>

The value to format.

Returns

string

The formatted string.

Type Parameters

TCurrency

The currency type.

Applies to

ProductVersions
.NET8, 10