Skip to content
ConsoleMonster
Class

PresenterValues

ConsoleMonster.Presenters

Namespace
ConsoleMonster.Presenters
Assembly
ConsoleMonster
Modifiers
static

Value conversions shared by presenters, tone rules and aggregates.

Inheritance

  • object
  • PresenterValues

Methods

public static string Dash(PresenterContext context) #

The placeholder for a value that has no meaningful display (an unbounded duration, a non-finite number): an em dash, or "-" in the ASCII tier.

Parameters

context ConsoleMonster.Presenters.PresenterContext required
The presenter context.

Returns

string The dash.
public static bool IsEmpty(object? value) #

Whether a value counts as empty (null, DBNull or an empty string).

Parameters

value object? required
The value.

Returns

bool True when empty.
public static bool IsNonFinite(object? value) #

Whether a value is a NaN or infinite double or float (shown as a dash).

Parameters

value object? required
The value.

Returns

bool True for NaN and infinities.
public static string ToText(object? value, CultureInfo culture) #

Formats any value as plain text with the culture (dates and numbers included).

Parameters

value object? required
The value.
culture System.Globalization.CultureInfo required
The culture.

Returns

string The text.
public static bool TryGetNumber(object? value, out double number) #

Converts a value to a double when it is a finite number (numbers, numeric strings in invariant format, TimeSpan seconds). NaN and infinities are not numbers here, so totals, tone rules and scales skip them.

Parameters

value object? required
The value.
number double required
The number.

Returns

bool True when the value is numeric.