Table of Contents

Struct Cash

Namespace
Virtufin.Base
Assembly
Virtufin.Base.dll

Currency-tagged fixed-point quantity. Amount carries its own precision (N) so two Cash values representing the same monetary amount at different precisions are not equal.

public struct Cash
Inherited Members

Examples

var price = new Cash(Currency.CurrencySymbol.USD, new DecimalAmount(99, 95, 2));
Console.WriteLine(price); // "USD 99.95"

Constructors

Cash(CurrencySymbol, DecimalAmount)

Construct a cash amount.

public Cash(Currency.CurrencySymbol currency, DecimalAmount amount)

Parameters

currency Currency.CurrencySymbol

Currency of the amount.

amount DecimalAmount

Numeric amount.

Properties

Amount

The numeric amount. Precision is per-instance via N.

public DecimalAmount Amount { readonly get; set; }

Property Value

DecimalAmount

Currency

The currency of the cash amount.

public Currency.CurrencySymbol Currency { readonly get; set; }

Property Value

Currency.CurrencySymbol

Zero

A zero cash amount in USD.

public static Cash Zero { get; }

Property Value

Cash

Methods

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.