> For the complete documentation index, see [llms.txt](https://junkeh.gitbook.io/easyph/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://junkeh.gitbook.io/easyph/customize/placeholder-math.md).

# Placeholder Math

Theres 2 sections, Math and Chance.

***

## **Chance-Based Outputs**

Chance-based outputs allow randomized responses based on probability.

```yaml
placeholders:
  random_greeting:
    chance_outputs:
      - chance: 50
        output: '<green>Hello %player_name%!'
      - chance: 30
        output: '<gold>Hi %player_name%!'
      - chance: 20
        output: '<red>Hey %player_name%!'

```

50% chance: `<green>Hello Junkeh!`\
30% chance: `<gold>Hi Junkeh!`\
20% chance: `<red>Hey Junkeh!`

***

## Math Operations

Allows mathematical transformations on numeric placeholders.

```yaml
placeholders:
  math_example:
    placeholders:
      - '%player_level%'
    math_operation: 'x2,+5,^2'
    output: '<red>Level transformed: {result}!'

```

Example Input: `%player_level% = 3`

Steps:

* Multiply by 2 → `3 × 2 = 6`
* Add 5 → `6 + 5 = 11`
* Square the result → `11² = 121`

Final Output: `<red>Level transformed: 121!`
