> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# say_digits

> Return the digits in a string as words, one per digit, grouped with commas so the voice pauses between groups.

[ref-speech]: /docs/server-sdks/reference/python/agents/speech

Return the digits in `text`, one word each, as a voice should read a ZIP code, an
account number, or a phone number. Anything that isn't a digit separates groups,
and a comma between groups makes the voice pause.

```python
from signalwire.speech import say_digits
```

## Parameters

**`text`** `str | int` — required

The digits, with any separators.

---

**`group`** `int | Sequence[int] | None` — default: None

How to group the digits.

* `None` -- keep the groups `text` already has, split at anything that isn't a digit.
* An `int` -- split the digits into groups of that size.
* A sequence of sizes -- split the digits into those sizes, in order, with any
  remaining digits in a last group.

Raises `ValueError` for a size below 1.

---

**`zero`** `str` — default: zero

Keyword-only. The word for 0, such as `"oh"`.

---

## Returns

`str` -- The words, with groups separated by `", "`, or `""` when `text` has no digits.

## Example

```python
from signalwire.speech import say_digits

print(say_digits("415-555-0192"))
# four one five, five five five, zero one nine two
print(say_digits("10001", zero="oh"))
# one oh oh oh one
print(say_digits("18005550199", group=(1, 3, 3)))
# one, eight zero zero, five five five, zero one nine nine
```

Part of the [speech helpers][ref-speech] module.