Skip to content
ConsoleMonster

API Reference

Class

NumberPresenter

Namespace ConsoleMonster.Presenters
Assembly ConsoleMonster
Implements
Modifiers sealed

A number, right-aligned, with the culture's thousand and decimal separators and an optional unit: 12,480, 8.4 rules/s, 97.5 %. Non-numeric values are shown as text.

Inheritance

  • Object
  • NumberPresenter

Constructors

public NumberPresenter(String? unit = null, Int32? decimals = null) #

Creates a number presenter.

Parameters

unit System.String? = null optionalposition: 0
A unit appended after a space (muted), or null.
decimals System.Int32? = null optionalposition: 1
Fixed decimals, or null for automatic: in a table column the most decimals any of its numbers needs (at most two), elsewhere up to two (none for whole numbers).

Methods

public PresentedValue Present(Object? value, PresenterContext context) #
Returns: PresentedValue

Presents a value.

Parameters

value System.Object? requiredposition: 0
The raw value (may be null).
context ConsoleMonster.Presenters.PresenterContext requiredposition: 1
Culture, clock, time zone, column statistics and the render context.

Returns

The presented value.

Properties

public String? Unit { get; } #

The unit, or null.

public Int32? Decimals { get; } #

Fixed decimals, or null for automatic.