# If Number is Close to Other Number

> Check if a number is close to another number within a specified tolerance.

- ID: `if_number_close_to_other_number`
- Type: Condition
- Category: [Math](https://inventor.bot/docs/reference/blocks/math.md)

- Condition block: write `if if_number_close_to_other_number(Args{...}) { ... }`, or use it as a `"true"`/`"false"` value. See conditions.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `number_1` | yes | First number. | e.g. `"10"` |
| `number_2` | yes | Second number. | e.g. `"10.2"` |
| `tolerance` | yes | Inclusive tolerance between the numbers. | e.g. `"0.5"` |
| `if_true` |  | Blocks to run when the numbers are close. | blocks: `func() { ... }` |
| `if_false` |  | Blocks to run when the numbers are not close. | blocks: `func() { ... }` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `result` | Whether the numbers are within tolerance. | e.g. `"true"` |

**Example**

```go
if if_number_close_to_other_number(Args{
	number_1:  10,
	number_2:  10.2,
	tolerance: 0.5,
}) {
	send_text_message(Args{channel_id: trigger.channel_id, message_content: "Yes"})
}
```