FormatMoneyMin
Definition
- Namespace
- Resto.Front.PrintTemplates.Cheques.Razor
Formats money without a fractional part when currency rounding produces an integer.
string TemplateBaseCore<T>.FormatMoneyMin(decimal money)
- Returns
string- Nullability
- Not specified
- Declared in
- Resto.Front.PrintTemplates.Cheques.Razor.TemplateBaseCore<T>
- Model purpose
- Base class for RazorEngineCore print templates. Model contains the document data of type T. Provides formatting and markup output methods.
Parameters
decimal money- Amount in the selected currency; this method does not convert currencies.
Return value
An integer string when the currency-rounded value is integral; otherwise the result of FormatMoney.
Remarks
The integer branch formats the ORIGINAL amount with f0; it does not print the denomination-rounded amount. For example, with a denomination of 5, 12.3 can print as 12 even though the denomination-rounded value is 10. The fractional branch uses currency precision and denomination. Uses CurrentCulture.
Exceptions
System.InvalidOperationException- The engine currency provider has not been initialized.
System.Collections.Generic.KeyNotFoundException- The current currency ISO code is absent from the engine currency catalog.
System.ArgumentOutOfRangeException- The configured minimum denomination is negative.
System.OverflowException- Denomination rounding exceeds the Decimal range.
Example
// en-GB, precision: 2, minimum denomination: 0 FormatMoneyMin(12m); // "12" FormatMoneyMin(12.30m); // "12.30"