> 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_last_digits

> Return the last digits of a number as words, one per digit, for "the card ending in" read-backs.

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

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

Return the last `n` digits of `text`, one word each, as one group: for "a card
ending in" or "the account ending in". Separators in `text` are ignored. The words
come from [`say_digits()`][say-digits].

```python
from signalwire.speech import say_last_digits
```

## Parameters

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

The number, with any separators.

---

**`n`** `int` — default: 4

How many of the last digits to say. Raises `ValueError` unless it's a whole
number of at least 1.

---

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

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

---

## Returns

`str` -- The words, or `""` when `text` has no digits.

## Example

```python
from signalwire.speech import say_last_digits

print(say_last_digits("4111 1111 1111 1234"))
# one two three four
print(say_last_digits("+1 415 555 0102", n=2, zero="oh"))
# oh two
```

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