Class
NumberPresenter
ConsoleMonster.Presenters
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, int? decimals = null) #Creates a number presenter.
Parameters
- unit string? = null
- A unit appended after a space (muted), or null.
- decimals int? = null
- 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) #Presents a value.
Parameters
- value object?
- The raw value (may be null).
- context ConsoleMonster.Presenters.PresenterContext
- Culture, clock, time zone, column statistics and the render context.