Skip to content
ConsoleMonster

API Reference

Class

NumberPrompt

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Base Prompt<Decimal>
Modifiers sealed

A number: whole or decimal, with a minimum and maximum shown as a hint, Up/Down stepping by NumberPrompt.Step (PgUp/PgDn by ten steps), and an inline error for text that is not a number or out of range.

Inheritance

  • Prompt<Decimal>
  • NumberPrompt

Constructors

public NumberPrompt(String title) #

Creates a number prompt.

Parameters

title System.String requiredposition: 0
The question.

Methods

public override String Describe(Decimal value) #
Returns: String

The answer as text, for the summary line left in the scrollback.

Parameters

value System.Decimal requiredposition: 0
The answer.

Returns

The text.

Properties

public Boolean WholeNumber { get; set; } #

Whether only whole numbers are accepted.

public Decimal? Minimum { get; set; } #

The smallest accepted value.

public Decimal? Maximum { get; set; } #

The largest accepted value.

public Decimal Step { get; set; } #

The step of Up and Down.

public CultureInfo? Culture { get; set; } #

The culture that parses and formats the number; null uses the current culture.

public Func<Decimal, String?>? Validator { get; set; } #

A validator after range checks: returns an error message, or null.