RollResult.ToString Method ()

From DiceRoller Documentation

Display a representation of the roll. Overrides Object.ToString().

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

public override string ToString()

Return Value

Type: System.String

The representation of the roll.

Remarks

The representation is displayed as "dice expression => die results => total". Dice expression is the normalized expression (generated via RollResult.RollRoot.ToString()). Die results displays the value rolled for each die, possibly marked with various flags. The total is the total of the roll or the number of successes.

Die results may be marked with any of the following flags:

  • A "+" before the die value indicates the die was a success.
  • A "~" before the die value indicates the die was a failure (negative success).
  • A "*" after the die value indicates the die was dropped.
  • A "!" after the die value indicates the die was a critical and/or fumble.

For example, in the expression "(2d20 + 2) * 1.5", assuming 8 and 20 were rolled, the following will display: "(2d20 + 2) * 1.5 => (8 + 20! + 2) * 1.5 => 45".